how to remove back slashes from json output in php -


the code 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 fix api

try stripslashes()

echo stripslashes('{\"test\":{\"test1\":{\"test1\":[{\"test2\":\"1\",\"test3\": \"foo\",\"test4\":\"bar\",\"test5\":\"test7\"}]}}}'); 

stripslashes()


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - How can I echo out this array? -

javascript - IE11 incompatibility with jQuery's 'readonly'? -