N
N
NBN2015-11-05 20:02:03
PHP
NBN, 2015-11-05 20:02:03

PHP how to save file with "\"?

I have a string with "=" instead of "\u003d". I fixed it with str_replace. But when I saved it to a json file, the "\" in "\u003d" was replaced with "\\". If it is displayed using echo, then this is not observed. How to save a file normally so that there is only one "\"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Skobkin, 2015-11-05
@skobkin

Normal - this is just when you have such characters escaped. Any normal JSON parser reads correctly, and when the data is deserialized, there is no more escaping backslash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question