JSON decode with PHP: Key started with @ sign -


json like

{     "@http_status_code": 200,     "@records_count": 200,     "warnings": [],     "query": { ... ... 

in php

$data = json_decode($json_entry); print $data->@http_status_code; //returns error print $data->http_status_code; //returns nothing 

how can retrieve status code?

try json_decode json in form of array ..

$json_array     =  json_decode($data, true); $required_data  = $data['required_key'] 

with reference particular problem .. array

array ( [@http_status_code] => 200 [@records_count] => 200 [warnings] => array     (     )    .... )  

so can access data $data['@http_status_code']


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -