Text formatting in user input

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
Glowing Face Man
Forum Newbie
Posts: 7
Joined: Fri Oct 16, 2009 3:56 pm

Text formatting in user input

Post by Glowing Face Man »

Hi everyone,

I want to take user input from a database and print it on the appropriate pages... I'd like to parse it so as to allow my users to mark it up, just like you can do in this forum, e.g. with [ url="whatever.com" ]link[ /url ] (minus the spaces).

Of course that'll be a lot of work to code from scratch... is there a standard function already written somewhere to do exactly this?

Thanks :D
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: Text formatting in user input

Post by markusn00b »

Glowing Face Man wrote:Hi everyone,

I want to take user input from a database and print it on the appropriate pages... I'd like to parse it so as to allow my users to mark it up, just like you can do in this forum, e.g. with [ url="whatever.com" ]link[ /url ] (minus the spaces).

Of course that'll be a lot of work to code from scratch... is there a standard function already written somewhere to do exactly this?

Thanks :D
There aren't any functions/classes in the PHP core, but there are a few community written libraries such as HTML_BBCodeParser library from PEAR.

Mark.
Post Reply