$str=preg_replace(">.* abc.*<"/gi,">.*CCC.*<",$str);
解决方案 »
- ./和/的区别
- 如何匹配所有的css文件
- 各位,奇怪的问题!事件查看器中可以看到insert的语句,sql放到查询分析器中执行也可以插入数据,但是程序就是没有插入数据!!!
- PHP 的flush缓冲问题
- 介绍一个好的开源的php论坛,最好是有blog功能,mysql版,Discuz!用文本做数据库有点担心!
- 用phpMyAdmin远程连接,#1130 - Host '192.168.0.1' is not allowed to connect to this MySQL server
- 在win2000上装Apache怎么提示端口出问题
- 向大家请教PHP的类的问题,关于PHP的重载。
- 高分求教一个javascript的难题,急呀!
- 我已解决文字简繁体问题,现在还有一点小问题。如何判断输入的字体是简体还是繁体
- 怎样在点了SUBMIT之后,插入一条数据库记录?
- 这段话在html里有用,怎么在php中就不起作用了呢?请大家来看看!
preg_match_all('/>(.*)</i',$str,$getstr);
$getstr = preg_replace('/abc/i',"CCC",$getstr[1][0]);
$str = preg_replace('/>(.*)</iU',">".$getstr."<",$str);
echo "$str";
$str='<img src="abc def abc fsdae" abc> abc f abc gf<abcd>';
$str=preg_replace("/(?!(?<=<)[^<>]*?)abc(?!([^<>]*(?=>)))/Uisx","CCC",$str);
echo htmlspecialchars($str);
%>