php str_replace替换特殊字符

 替换单引号,双印,正斜杠,反斜杠等等,and,select等等
<?php

$str = 'a\bc"1\'2d4/e/fgh\\\abc\\//a"bandan\'and';
echo $str.'<br>';
$search = array(1, 2, 3, 4, 5, 6,'*','$','\\','/',"'",'"',"and");
echo str_replace($search, '', $str);//abcdefghabcaban
echo '<hr>'; ?>
上一篇:repo安装


下一篇:ArcGIS API for JavaScript 入门教程[2] 授人以渔