【发布时间】:2020-06-17 20:20:23
【问题描述】:
$url = 'https://sheets.googleapis.com/v4/spreadsheets/...';
$json= file_get_contents($url);
$obj = json_decode($json);
$obj = $obj->{'values'};
print_r( $obj);
来自谷歌表的响应如下:
{ "range": "Recipes!D10:E10", "majorDimension": "ROWS", "values": [ [ "65", "122.9" ] ] }
在我用上面的代码行解码响应后,它是这样的:
Array ( [0] => Array ( [0] => 65 [1] => 122.9 ) )
// How to extract the data "65" and "122.9" from this decoded response ?
【问题讨论】:
标签: php google-sheets-api