开发者

How to output multiple line mysql string from database without quotes

I'm retrieving a string from a database that was entered by a form, but if the string is to long, it's generated with double quotes in the html. This is how I'm retrieving the data:

echo '<p>' . $descr['field_value'] . '</P>';

When I view the html source, the browser adds double quotes.

short single line strings do not show up with quotes.

Is there a way to force php t开发者_C百科o display strings without quotes?


You should use echo '<p>' . htmlspecialchars($desc['field_value']) . '</p>';.

See http://php.net/manual/en/function.htmlspecialchars.php for more details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜