请帮助尝试所有方法,没有任何效果。我正在使用PHP 7向MySQL DB插入一些代码,然后插入代码,这一切都很好;因此:
Eg:
<p>Hello:<b>Amber</b>\r\n<div>\r\n<hr>\r\n\r\n<button onclick=\"insertTextAtCursor()\">Lisa sisend</button>
当我在HTML中使用PHP调用记录集时,由于HTML代码被隐藏,因此不会显示任何内容。
我需要以纯文本形式显示HTML代码,但“不显示\r\n显示换行符” - 格式化;因此:
Eg:
<p>Hello:<b>Amber</b>
<div>
<hr>
<button onclick=\"insertTextAtCursor()\">Lisa sisend</button>
纯css和javascrpt代码在这个PHP行中很好地显示出来,但不是HTML:
$author_code1 = null;
$author_code1 = $row["author_code1"];
$author_code1 = str_replace('\r\n', '<br />', $row['author_code1']);
echo $author_code1;
更接近它,因此添加:
<?php
echo "<xmp>";
echo str_replace("\r\n", "<br/>", $author_code1);
echo "</xmp>";
?>
这在一行中显示所有内容:
</html>\r\n </textarea>\r\n</div>\r\n </div>\r\n</section>\r\n<button>Lisa send</button>
我的问题是为什么它没有突破到下一行?喜欢:
<div>
<p>Hello:<b>Amber</b></p>
</div>
<hr>
<button>Lisa send</button>
请帮忙。
陪伴而非守候