Problems related to escaping (replacing strings) strings containing Chinese characters
Source: Internet
Author: User
For example, I want to replace the \ escape character in the string with \, but the character string "escape character" does not exist \, the second byte of "bytes" is the same as the value of "\", so it is changed to "\". it is displayed as "bytes \". how can this problem be solved ?, It's not very clear what you mean. try to escape (replace strings) strings that contain 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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service