Home  >  Article  >  Backend Development  >  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
WBOYOriginal
2016-07-13 10:53:081069browse

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...
Statement:
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