remove slashes from json php

61

php remove slash from string -

echo preg_replace('/\\\\/', '', $var);

php remove slashes from json -

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

remove slashes from json -

var finalData = str.replace(/\\/g, "");

Comments

Submit
0 Comments