Czy ktoś może mi wytlumaczyć jak zmienić poniższy kod aby zwracał wynik tylko raz (odpalony w wordpresie).
Na komputerze stacjonarnym wszystko jest oki, natomiast kod wywołany w wordpresie w pierwszej linii zwraca wszystkie wyniki razem i dopiero potem zaczyna je właściwie wyświetlać.
<?php // Parsing this spreadsheet: <a href="https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html" target="_blank">https://spreadsheets.google.com/pub?key=0Ah...amp;output=html</a> $url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; $json = json_decode($file); $rows = $json->{'feed'}->{'entry'}; foreach($rows as $row) { $title = $row->{'gsx$title'}->{'$t'}; $author = $row->{'gsx$author'}->{'$t'}; $review = $row->{'gsx$review'}->{'$t'}; } // See this here: <a href="http://imagine-it.org/google/spreadsheets/showspreadsheet.php" target="_blank">http://imagine-it.org/google/spreadsheets/...spreadsheet.php</a> ?>
Wynik:
Pierwsza linia zawiera wszystkie rekordy:
The Cyberiad by Stanislaw LemFantastic. Sci-fi short stories with beautifully crafted language and made up words.The Chemistry Between Us: Love, Sex, and the Science of Attraction by Larry YoungFascinating, research into the chemicals, genes, and neurotransmitters that influence gender and attraction.Plan B: A Novel by Jonathan TropperA fun read, got me through an airplane ride.Sock […]
Kolejne linie wyświetlają się tak jak chcę:
The Cyberiad by Stanislaw Lem
Fantastic. Sci-fi short stories with beautifully crafted language and made up words.
The Chemistry Between Us: Love, Sex, and the Science of Attraction by Larry Young
Fascinating, research into the chemicals, genes, and neurotransmitters that influence gender and attraction.
Plan B: A Novel by Jonathan Tropper
A fun read, got me through an airplane ride.
itd...
Proszę o pomoc i pozdrawiam.