$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 ?
莫回无
DIEA
达令说