【发布时间】:2021-12-15 22:01:29
【问题描述】:
例如我有:Today is | nice day | go to | school now | and enjoy | your life |.
我试过了:
$text = str_replace('| ','"',$text);
$text = str_replace(' |','"',$text);
结果是:
Today is "nice day "go to "school now "and enjoy "your life ".
你可以看到结果不好 -> ...day "go ; ...now "and ; ...life ".
结果应该是:Today is "nice day" go to "school now" and enjoy "your life".
我有很多这样的文字要替换,请帮忙!
【问题讨论】:
-
不明白
school | now | and怎么变成"school now" and -
对不起,我打字不好,这是 |现在上学|兄弟