how to replace smilies code with images?

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
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

how to replace smilies code with images?

Post by amir »

Hello,
I am storing user comments ( text + smilies ) in database. Text in simlpe format and smilies in code. For example,

hi
:uhh:
ok
:D

I have smilies images in a folder named smilies, now i want to know that how can I replace this smilie code with images?

thanx
smudge
Forum Contributor
Posts: 151
Joined: Sun May 20, 2007 12:13 pm

Post by smudge »

Look up the function eregi_replace on php.net. That should help you out.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Even just str_replace will work.
Post Reply