1

これは私の文字列です:

$a = "RSS
here: 
Your result: 3 points form 50 example.";

この文字列から「RSShere:」を削除するにはどうすればよいですか?

私の試み:

$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 に答える