我想从Google电子表格中检索数据并在我的网站上显示结果,而不是显示所有内容。
这是我的代码:-
$logfile = file("<LINK TO MY GOOGLE SPREADSHEET)");
$findme = 'code200';
foreach($logfile as $line_num => $line) {
$pos = strpos($line, $findme);
if ($pos === false) {
echo "The string '$findme' was not found in the string '$logfile'";
}
}
是的,Google 有一个用于 Google Drive 的电子表格 API:https://developers.google.com/google-apps/spreadsheets/
这是一个 PHP 库,可让您访问电子表格 API:https://github.com/asimlqt/php-google-spreadsheet-client
那里可能还有其他库。谷歌"PHP google spreadsheet API"
.