我想从字符串中删除 ¶ 段落标记。 我已经尝试过 strip_tags 和 preg_replace,但它不起作用。该字符串位于 mysql 记录中。在将它保存到数据库之前和显示它之前,我已经尝试将其删除,但似乎没有任何效果。
感谢任何帮助。
最佳答案
使用 ¶ 显示您的真实字符串,因为这非常有效:
<?php
$string = 'Hi¶ this is a string with a paragraph¶';
$string = str_replace( "¶", "", $string );
echo $string;
?>
输出
Hi this is a string with a paragraph
关于php - 使用 php 从字符串中删除 ¶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11576416/