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!
I am trying to make it so when I make a post on my site a : ) will display as a smiliy face. (note the extra spaces so it shows here )
I have been reading up on preg replace but just dont quite know how to do it. I Currently use preg replace to get rid of extra white spaces. I do not want to just search for one symbol to replace. I want to go though a Database of icons to show. I also do not want to permanantly replace them like doing it before storing into database. Just when it is shown.
So if I have a $message how do you go though and preg replace and then have it print out?
At this moment I have looked at over 50 posts here and none of them helped me. I have checked out php.net as well. I even have looked at all my php books.
is your list in a database? I just want a : ) to show a smiley and was setting it up in a database to show the correct one. My database I put in the symbols and what graphic goes with it.
i have a function to read the directory they are in and grab the names, that way i can add to the directory, rename in the directory, or remove from the directory and everything gets updated automatically
Okay. I see what you are saying. they click on a smilie and it does it. I was thinking of if you did not click on a smilie but just typed in the normal symbols.
heh, i don't have my code help page set up to insert smilies on clicking or for them to even display int he post. just when used, although the help page calls the list and goes through the array to tell the user what is there.