How to add and remove backslashes before quotation marks in PHP

WBOY
Release: 2016-07-25 08:57:45
Original
1465 people have browsed it
  1. $str=$_POST["str"];//Read the content of str and assign it to the $str variable
  2. if(get_magic_quotes_gpc())//If get_magic_quotes_gpc() is turned on
  3. {
  4. $str=stripslashes($str);//Process the string
  5. }
Copy the code

After modification, the PHP program tested normally both locally and on the website. Related Reading : How to add backslash before php quotes (remove backslash in PHP)



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template