I would like to get the value of "Records"
When is try this code:
$json = file_get_contents('URL');
var_dump($json);
This is the result:
string(25289) "{ "ProductsSummary": { "Records": 10, "TotalRecords": 2874, "TotalPages": 288, "CurrentPage": 1 }, "Products": [ { "...
When I try this code
$json = file_get_contents('URL');
$obj = json_decode($json);
echo $obj;
echo $obj->{'ProductsSummary'}->{'Records'};
echo $obj->ProductsSummary->Records;
echo $obj[0]->ProductsSummary->Records;
echo $obj->ProductsSummary[0]->Records;
echo $obj->ProductsSummary[1];
The Output is:
{ "ProductsSummary": { "Records": 10, "TotalRecords": 2879, "TotalPages": 288, "CurrentPage": 1 }, "Products": [ { "Last.... }
Notice: Trying to get property of non-object in ...
Notice: Trying to get property of non-object in ...
Notice: Trying to get property of non-object in ...