1

这是我的字符串:

$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;
4

2 回答 2

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.
于 2012-07-02T07:21:10.080 回答
0

如果您在此处的 RSS 中没有特殊字符:应该这样做

$result = str_replace("RSS here:", "", $a);
于 2012-07-02T07:17:47.307 回答