In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
How to use json in php to remove escape characters, I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
In PHP, you can remove the escape characters from the json data through the stripslashes function, which uses the syntax of "stripslashes (string)", and its parameter string represents the string to check.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
How does php json remove escape characters?
Php has an escape character processing method when accepting json data.
Because now almost all data transmission is in json format, and escape processing is usually done when converting data into json. At this time, if you directly use the json_decode function to process the accepted json data, the system will definitely report an error, because the conversion cannot be done, and the processing method is very simple, that is, you can remove the escape characters from the json data. Php has a function stripslashes () that does this. Its function is to remove the backslash added by the addslashes () function Of course, the backslash in the string can be removed.
Introduction to related functions:
The stripslashes () function removes the backslash added by the addslashes () function.
Tip: this function can be used to clean up data retrieved from a database or from an HTML form.
Grammar
Stripslashes (string)
Parameters.
String is required. Specifies the string to check.
Return value: returns a string with a stripped backslash.
After reading the above, do you know how to use json in php to remove escape characters? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.