主要使用了php的stristr及str_ireplace函数
不区分大小写查找
<?php
$_findstr="bfw";
$_str="BfW is good site";
if(stristr($_str,$_findstr)!==false){
echo "查找到了";
}else{
echo "未找到";
}
不区分大小写替换
<?php
$_findstr="bfw";
$_relacestr="this site";
$_str="BfW is good site";
echo str_ireplace($_findstr,$_relacestr,$_str);
网友回复