Read JSON values from URL via PHP
问题 i have url with this simple JSON {"result":true,"data":[{"Position":"135"}]} I tried to read it with this: $json = file_get_contents('https://...link/here..'); $obj = json_decode($json); echo $obj->result[1]->data->Position; but it not works. Where i do a mistake? Thanks for helping! 回答1: You are incorrectly addressing the data in the PHP object created from the JSON String $json = file_get_contents('https://...link/here..'); $obj = json_decode($json); echo $obj->data[0]->Position; Or if