我的代码不工作?而且我不想使用 str_replace ,因为可能有比 3 更多的斜线被替换。我如何使用 preg_replace 完成这项工作?
我的代码是这样的:
<?php
$str='<li>
<span class=\"highlight\">Color</span>
Can\\\'t find the exact color shown on the model pictures? Just leave a message (eg: color as shown in the first picture...) when you place order.
Please note that colors on your computer monitor may differ slightly from actual product colors depending on your monitor settings.
</li>';
$str=preg_replace("@\\+@","\\",$str);
echo $str;