There is also a much easier, but less clean solution, if you don’t want to bother with the API or Google Authentication.
- Go to your Spreadsheet in Google Drive.
- Go to File -> Publish to the Web
- In the Publish to the web dialog you can get a .csv Link to your spreadsheet.

You can now access the contents like any other csv File on the Web.
Here is some sample code:
$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");