我有这些行:
Four41dk: folds
Masuronike: folds
Four41dk is sitting out
我用 str_replace 他们的名字“Four41dk,Masuronike”替换
<span class='bold'> $theirName </span: folds
<span class='bold'> $theirName </span: folds
etc...
这很有效,但问题是名称位于字符串末尾时,例如:
Four41dk: folds
Uncalled bet (73) returned to MASUR0N1KE
Four41dk is sitting out
现在,当我更换刻痕时,我在 RETURNED TO MASURONIKE 后丢失了新行,因此输出在一行中,例如:
Uncalled bet (73) returned to <span>MASUR0N1KE </span> <span> Four41dk </span> is sitting out
请问我该如何解决?
我想我需要类似的东西:
用 Span 替换 NAME 的名称,但当有 \n 之后,请保留它