Skip to content

Instantly share code, notes, and snippets.

@kosinix
Last active December 18, 2015 18:49
Show Gist options
  • Save kosinix/5828475 to your computer and use it in GitHub Desktop.
Save kosinix/5828475 to your computer and use it in GitHub Desktop.
Google spreadsheet reader in PHP
<?php
// URL to spreadsheet. Make sure to append ?alt=json to return contents in JSON format
$url = 'https://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json';
$file= file_get_contents($url);
$json = json_decode($file);
echo '<pre>'.print_r($json, 1).'</pre>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment