Home > Backend Development > PHP Tutorial > I want to add a backslash to all single quotes. What should I use_PHP Tutorial

I want to add a backslash to all single quotes. What should I use_PHP Tutorial

WBOY
Release: 2016-07-13 10:53:08
Original
1128 people have browsed it

First, please refer to the English addslashes() function, which can achieve the function you want. You should also refer to the magic_quotes_gpc option set in php3.ini.
The function ereg_replace() can achieve the result you want. The method is as follows:
$escaped = ereg_replace("'", "'", $input);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632420.htmlTechArticleFirst of all, please refer to the English addslashes() function, it can achieve the function you want, you should also refer to it The magic_quotes_gpc option set in php3.ini. The function ereg_replace() can achieve what you want...
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