For example, if I want to replace the escape character in a string with \, but the character string "escape character" does not exist, it is only because the second byte of "bytes" is the same as the value, so it is changed to "\". it is displayed as "bytes". how can this problem be solved? ------ Solution -------------------- it is not clear what you mean to try the php replacement function str_replace () to escape (replace strings) strings containing Chinese characters
For example, I want to replace \ escape \\
However, the string "bytes" does not contain \, but the second byte of "bytes" is the same as the value of \, so it is replaced \\, this shows that it is "too many \".
How can this problem be solved?
------ Solution --------------------
Not very clear what you mean
Try the php replacement function str_replace ()
------ Solution --------------------
Remove the slash from stripslashes
This function removes the backslash from the string.
If there are two backslash lines in a row, remove one and leave one. If there is only one backslash, remove it directly.