解决方案 »
- 有PHP砖家,推荐个好用的PHPCMS嘛
- 关于magic_quotes_gpc为on的疑惑
- phpmyadmin配置中扩展设置mbstring的问题
- ★★★★直接访问上传临时文件时, 遇到的问题!★★★★
- !!! 怎样实现“域名查询”结果能显示中文???
- 请问如何做读取一个目录下面的文件名,然后把文件名插入数据库
- 为什么有的表单提交失败后退后填写的内容还在,有的表单却不能保存上次填写的内容
- 是不是用phptrade一安装就正常用php,mysql,apache了?
- mp3的播放列表是怎么做的呀?
- 我把800*600的jpg图,用imagecopyrise()函数缩小成100*75后,变得很不清楚
- 用数据库存储图像的问题?
- include virtual= 为什么显示啊
$str='<div style="background:#EFF2FA;overflow:hidden;padding:0 3px;line-height:29px;height:30px;word-break:normal;">adfadfadfadfadfadad</div>';
echo preg_replace("/\<div.+?\>(.*?)\<\/div\>/","123456",$str);
?>
$str='<div style="background:#EFF2FA;overflow:hidden;padding:0 3px;line-height:29px;height:30px;word-break:normal;">adfadfadfadfadfadad</div>';
echo htmlspecialchars(preg_replace("/(\<div.+?\>)(.*?)(\<\/div\>)/","\${1}123456\${3}",$str));//<div style="background:#EFF2FA;overflow:hidden;padding:0 3px;line-height:29px;height:30px;word-break:normal;">123456</div>
?>
前面 后面有好多的DIV 但是就这个
<div style="background:#EFF2FA;overflow:hidden;padding:0 3px;line-height:29px;height:30px;word-break:normal;">
是一个唯一 ,这个该如何写正则?