Home > php教程 > php手册 > 字符前加上反斜杠,包括 单引号、双引号、反斜杠 php代码

字符前加上反斜杠,包括 单引号、双引号、反斜杠 php代码

WBOY
Release: 2016-06-13 10:11:33
Original
857 people have browsed it

字符前加上反斜杠,包括 单引号、双引号、反斜杠 php教程代码

function d_addslashes($string, $force = 0) {
 if(!$globals['magic_quotes_gpc'] || $force) {
  if(is_array($string)) {
   foreach($string as $key => $val) $string[$key] = d_addslashes($val, $force);
  }
  else $string = addslashes($string);
 }
 return $string;
}
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template