开发者

Formatting issue with Zend textarea

I have a text area which I use to entered the following text with those line breaks, so it looks like paragraphs already. I save it into the database, and I can see the format is still being preserved.

This is some text.

And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line.

And this another line. And this another line. And this another line. And this another line. And this another line.

But when I pull the data from the database and display it, it looks all like 1 line.

This is some text. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. Clip 1 by user 1 And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line. And this another line.

but when I view the HTML source, I see it's separated into 3 lines.

开发者_如何学编程

What should I do to make it display in 3 paragraphs?


When you display the text you may have to wrap it in a call to nl2br:

echo nl2br($test);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜