How can i change this to a JSON Array? im using the eval technique but this is not working. Im getting this kind of response from our upx server:
array(
'invoice' => array(
'id' => '4',
'realid' => '4',
'address_rev' => NULL,
'relation_data_id' => '3',
'contact_set_rev' => '3',
'business_data_rev' => '4',
'private_data_rev' => NULL,
// etc..
)
);
var_dump($newdata); // String
eval("\$newdata = \"$newdata\";");
var_dump($newdata); // Still stays as a string as shown above....
Any clue?
Ty Already!
You’ll facepalm really bad when I tell you this..
But the reason it’s still a string is because you wrapped it in
""inside your call toeval, and of course wrapping letters inside of quotes will make it.. (drum roll ..) a string.If you want to turn it into json right away, use the below: