你需要这样的东西:
$json = '{ "Parameter": { "LookupName": "EmailAddress",
"LookupValue": "asdasd@fgdfg.dfg"
},
"Columns": { "Include_CSV": "ProspectID",
"FirstName": "",
"LastName": "",
"EmailAddress": ""
},
"Sorting": { "ColumnName": "FirstName",
"Direction": "1"
},
"Paging": { "Offset": 0,
"RowCount": 200
}
}';
$array = json_decode($json, true);
var_dump($array);
输出
array (size=4)
'Parameter' =>
array (size=2)
'LookupName' => string 'EmailAddress' (length=12)
'LookupValue' => string 'asdasd@fgdfg.dfg' (length=16)
'Columns' =>
array (size=4)
'Include_CSV' => string 'ProspectID' (length=10)
'FirstName' => string '' (length=0)
'LastName' => string '' (length=0)
'EmailAddress' => string '' (length=0)
'Sorting' =>
array (size=2)
'ColumnName' => string 'FirstName' (length=9)
'Direction' => string '1' (length=1)
'Paging' =>
array (size=2)
'Offset' => int 0
'RowCount' => int 200
访问它
echo $array['Parameter']['LookupValue']; // Returns asdasd@fgdfg.dfg