Page 1 of 1

How render html in php

Posted: Mon Mar 09, 2009 3:14 am
by arkkundan
Dear Friends,

I have a web admin module for one of my websites. Through this admin person enters some data which is stored in db and then it is showed on website. (I guess this fairly explains what is the admin module.)

Now problem is when all the data entered in the db appears on the web page as a single paragraph. I wan't the admin person to be able to format the text that s/he has entered.

Like wise, the data fetched from the db could be displayed in seperate paragraphs on web page.

What should I do to achieve this. I have tried the php functions htmlspecialchars and htmlentities but didn't get the desired result. May be I have not used them properly.

Any help is greatly appretiated.

Re: How render html in php

Posted: Mon Mar 09, 2009 3:25 am
by Benjamin

Code: Select all

 
echo nl2br("
Hello
World");
 

Re: How render html in php

Posted: Mon Mar 09, 2009 10:12 am
by pickle
You may be able to use a Rich Text Editor like FCKEditor or TinyMCE.