为什么';a';转换为&;nbsp


Why 'a' convert to &nbsp

我有问题。我使用wordpress,从昨天开始不工作链接在数据库中,我有代码:

<a href="dakjhd">text</a>

但在wordpress的文本编辑器中,我有

&nbsp text &nbsp

我不知道为什么一个皈依&nbsp

现在我无法添加链接。。。

请帮助

步骤中:

  1. 将链接添加到我的文本
  2. 我在数据库中查看此文本,然后看到<a href="dakjhd">text</a>
  3. 我在文本编辑器中查看此文本,然后看到&nbsp text &nbsp
  4. 我不知道

您的代码可能正在使用strip_tags()从实际HTML中删除标记。您可以使用html_entity_decode将其恢复为原始形式。

示例:

<?php
$link = '<a href="dakjhd">text</a>';
$a = strip_tags($link);
$b = htmlentities($link);
$c = html_entity_decode($b);
echo $a; // output: text
echo $b; //output: <a href="dakjhd">text</a>
echo $c; //output: the actual link
?>

希望这能消除你的疑虑!