peranha Posted December 10, 2007 Share Posted December 10, 2007 Can anyone help me to convert to an image such as this website does on the posts? I input the code into my database, and would like to get the image when looking at posts, or do I have to insert img code into the database. Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 <?php $s = "hello:)"; echo str_replace('','<img src="smillie.jpg">',$s); ?> Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted December 10, 2007 Share Posted December 10, 2007 better idea is <?php $smiles = array("","") $replacements = array("<img src=\"smiley.jpg\" />","<img src=\"sad.jpg\" />"); $string = " Happy Sad"; $string = str_replace($smiles,$replacements,$string); echo $string; Quote Link to comment Share on other sites More sharing options...
peranha Posted December 10, 2007 Author Share Posted December 10, 2007 Thanks, The array is what I was looking for. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.