Mortier Posted September 29, 2006 Share Posted September 29, 2006 Hello people, I use the following program to make smilies-images out of shortcuts like :) and :P.[code]<?function makeSmiley($content){ //bij het toevoegen van een smiley, let wel dat de eerste smiley 0.gif (of 0.jpg) wordt. $smilies = array ( "", //0 ":)", //1 ":P", //etc ":D", ":(", ";)", ":S", ":'(", ":@", ); //$replace = de key //$smiley = de waarde, bijv. :) foreach($smilies as $id => $smiley) { $replace = '<img src="img/smileys/' . $id . '.gif" alt="' . $smiley . '" />'; $content = str_replace($smiley, $replace, $content); //Search, Replace, Content } return $content; }?>[/code]Unfortunately I can't get it to make :p into an image because it only recognizes the capitalized P.. I've tried everything changing the replace thing do both (strtolower etc..)But it just won't work...I can't use PHP 5 functions btw. 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.