How render html in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arkkundan
Forum Newbie
Posts: 1
Joined: Thu Nov 20, 2008 4:14 am
Location: Pune

How render html in php

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: How render html in php

Post by Benjamin »

Code: Select all

 
echo nl2br("
Hello
World");
 
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How render html in php

Post by pickle »

You may be able to use a Rich Text Editor like FCKEditor or TinyMCE.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply