我目前正在使用此代码从数据库中打印多行文本
$query_content= "select * from home ";
$result_content= mysql_query($query_content,$con);
while ($text = mysql_fetch_array($result_content))
{
$content = $text['homecontent'];
}
Run Code Online (Sandbox Code Playgroud)
并使用此HTML代码:
<p>
<?php print $content; ?>
<p/>
Run Code Online (Sandbox Code Playgroud)
数据库中的文本是:
abc
def
ghi
Run Code Online (Sandbox Code Playgroud)
但我得到了这个
abc def ghi
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
谢谢.