okay just upload it to any website, and have $msg at everything you want to have a smiley face. YOU MUST HAVE THE SMILEY FILE NAME ON YOUR WEBSERVER/WEBSITE THE TEXT HAS TO BE THE SAME :p won't be the same as :P
<?php
function smiley($msg) {
$msg = ereg_replace("!","<img src=!.png alt=\"!\" >", $msg);
$msg = ereg_replace(":D","<img src=laugh.gif alt=\":D\" >", $msg);
$msg = ereg_replace(":p","<img src=tongue.gif alt=\":p\" >", $msg);
return $msg;
}
$msg = "Hi ! <br> Hello :D<br> Heheh :p";
echo smiley($msg);
?>
PHP newbie here....
this looks like it would be great for my site... I\'ve tried to get it runnng with no luck. couple of questions
1) what do i call the php file?
2) how do you get it to work lol. ie do you type \"$msg = :D\" to replace text to smiley.
could you explain a little please for me sorry
thanks C-P