Answers for "php string to object json"

PHP
0

php parse json

// scrap this:
$data = json_decode($rawdata);

// use this:
$data = json_decode($rawdata, true);
echo $data["key1"];
Posted by: Guest on March-03-2022
0

php json data to array

json_decode('{foo:"bar"}');         // this fails
json_decode('{"foo":"bar"}', true); // returns array("foo" => "bar")
json_decode('{"foo":"bar"}');       // returns an object, not an array.
Posted by: Guest on October-15-2021

Code answers related to "php string to object json"

Browse Popular Code Answers by Language