The Regular Expression in js is like this: {code ...} php is not written as follows: {code ...} my goal is to replace null in the string. How can I replace it? I tried it according to the answer below .. The reason is found because of json_encode (). How can this problem be solved...
The Regular Expression in js is as follows:
var str = "data\/ui_inner\/74\/";str.replace(/\\/,"");
Php is not written as follows:
$auto_url = preg_replace('/\\/','', $str);
My goal is to replace \ In the string with null. How can I replace it?
I tried it according to the answer below ..
The reason is found because of json_encode (). How can this problem be solved? Google me
Reply content:
The Regular Expression in js is as follows:
var str = "data\/ui_inner\/74\/";str.replace(/\\/,"");
Php is not written as follows:
$auto_url = preg_replace('/\\/','', $str);
My goal is to replace \ In the string with null. How can I replace it?
I tried it according to the answer below ..
The reason is found because of json_encode (). How can this problem be solved? Google me
We do not recommend that youjson_encodeBecausejson_encodePair/Escape output. For js, its content is still/Instead\/.
(PS: there are comments in the code below during the test.var_dump, Retain onlyecho)
Replaced:
Not replaced:
1.htmlThe Code is as follows: