Created
July 28, 2014 04:03
-
-
Save frozonfreak/1392a8e40d9e6a9b5974 to your computer and use it in GitHub Desktop.
Google Spreadsheet reading PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$spreadsheet_url="https://docs.google.com/spreadsheet/pub?key=<somecode>&single=true&gid=0&output=csv"; | |
if(!ini_set('default_socket_timeout', 15)) echo "<!-- unable to change socket timeout -->"; | |
if (($handle = fopen($spreadsheet_url, "r")) !== FALSE) { | |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | |
$spreadsheet_data[]=$data; | |
} | |
} | |
fclose($handle); | |
} | |
else | |
die("Problem reading csv"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment