Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PHP for parsing the JSON output a published Google spreadsheet and displaying columns from each row.
// Parsing this spreadsheet:
$url = '';
$file= file_get_contents($url);
$json = json_decode($file);
$rows = $json->{'feed'}->{'entry'};
foreach($rows as $row) {
echo '<p>';
$title = $row->{'gsx$title'}->{'$t'};
$author = $row->{'gsx$author'}->{'$t'};
$review = $row->{'gsx$review'}->{'$t'};
echo $title . ' by ' . $author . '<br>' . $review;
echo '</p>';
// See this here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment