首先,请参考英文的 addslashes() 函数,它能达到你想要的功能,你也应参考php3.ini设定的 magic_quotes_gpc 选项。
函数 ereg_replace()可以达到你要的结果,做法如下:
$escaped = ereg_replace("'", "'", $input);
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