我在论坛中有一段文字:
line one;
line two;
line three;
line four;
(结果由geshi制作 - $ geshi-> parse_code();)
我试图删除"
"使用
$result2=preg_replace("/&\#13;/", "", $result1);
但它不起作用。
奇怪的是:这在live php正则表达式测试器中成功完成:http://www.phpliveregex.com/
有专家可以就此提出建议吗?
非常感谢!
顺便说一句:
我尝试了var_dump
并且输出没有改变,除了标题改为字符串(5411)"见http://saslab.org
我还尝试使用/\r/
删除符号,但徒劳无功。
谢谢你的所有建议!
答案 0 :(得分:0)
看看这是否是你需要的:
<?php
$str="line one; line two; line three; line four; ";
$result2 = str_replace("
", ":", $str);//replace : with your required string.
echo $result2;
?>