The code I have used:
$val = json_encode(array("test"=>test1,"test2" =>test,"description" => description));
return $val;
The result im getting
{\"test\":\"test1\",\"test2\":\"test\",\"description\":\"description\"}
I need this to fix api
Try with stripslashes()
echo stripslashes('{\"test\":{\"test1\":{\"test1\":[{\"test2\":\"1\",\"test3\": \"foo\",\"test4\":\"bar\",\"test5\":\"test7\"}]}}}');
stripslashes()
Tried this.
$val = json_encode(array(
"test"=>'test1',
"test2" =>'test',
"description" => 'description'
));
$data = json_decode($val, true, JSON_UNESCAPED_SLASHES);
return $data;
This is the result I received.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With