这是我的字符串:
$a = "RSS
here:
Your result: 3 points form 50 example.";
如何从此字符串中删除“RSS here:”?
我的尝试:
$result = str_replace("RSS
here:
Your result: 3 points form 50 example.", " " ,$a);
echo $result;
答案 0 :(得分:1)
\r\n
使用carriage return + line feed
,例如新行:
$a = "RSS
here:
Your result: 3 points form 50 example.";
$result = str_replace("RSS\r\nhere:", "" ,$a);
echo $result;
<强>结果:强>
Your result: 3 points form 50 example.
答案 1 :(得分:0)
如果你的RSS中没有特殊字符:这应该是
$result = str_replace("RSS here:", "", $a);