我想通过XML读取谷歌电子表格api上的谷歌电子表格。
我尝试不同的方法,例如
<?php
$data = file_get_contents("https://spreadsheets.google.com/feeds/worksheets/WORKSHEET_KEY/private/full");
?>
或
<?php
simplexml_load_file(URL)
?>
但是我只给出一个空字符串。文档是公开的,如果我直接在网站上浏览,它就会工作。
你能帮我吗?
看看下面的文章:http://arlando.net/blog/connecting-to-google-spreadsheet-api-with-php/
我还建议从google API的https://developers.google.com/google-apps/spreadsheets/
这很可能与以下已回答的问题有关:
使用file_get_contents()加载远程xml页面
您的服务器可能不允许使用file_get_contents打开远程url。
此页面上接受的答案显示了使用curl