str_replace(" ","_","aa ee");
解决方案 »
- centos 下使用 yum 安装php 5.2.17 无法使用mysql_connect、json_encode等函数
- mysql 添加数据后在数据库里的排序
- Php页面中向数据库插入数据失败,但用控制台可以
- 字符串在数组中的匹配
- 菜鸟询问登陆问题
- 请教:为何不能删除指定的行
- 匹配问题
- 几率问题。
- 这是?????Fatal error: Maximum execution time of 30 seconds exceeded in E:\webdata\managerinfo.php on line 195
- 谁能给我加上注释?谢了,
- php中有没有类似asp种得 on error resume next 得功能
- 在php中如何获得cookie名
$text = preg_replace ("'([[:space:]]|;)+'si", "_", $document);
即
aa ee转换成aa_ee
aa:ee转换成aa_ee
aa e:e转换成aa_e_e
就是想实现这样的功能
$string="aa ee aa:ee aa e e";
echo(preg_replace($pattern,"_",$string));
$string="aa ee aa:ee aa e e";
echo(preg_replace($pattern,"_",$string));
---------------
Right.
$pattern="/[[:space:]|\:]+/";
$string="aa ee aa:ee aa e e";
echo(preg_replace($pattern,"_",$string));