我有一个问题,损失的运输回报,从长期的价值从MySQL。我不知道变量是否持有回车,或者当我使用echo时它们是否丢失。这是我的代码。代码假定MySQL查询已经运行。
$longstringValue = $row['longstringValue']; // The value from the database has carriage returns...
echo $longstringValue // but they aren't present when I echo the variable.我能做些什么来阻止这一切?
发布于 2014-07-28 05:50:18
行返回和回车在HTML中没有(可视)含义,因此,如果您需要这些中断来呈现,请在某个时候运行nl2br函数,如手册所示:
<?php
echo nl2br("foo isn't\n bar");
?>输出
foo isn't<br /> bar它呈现为
福可不是 条形
https://stackoverflow.com/questions/24988928
复制相似问题