Hi,
Don't know the right function to use here. I have a php file containing
text only that will contain references to smilies formatted such as "...
then I told him the punch line (wink) ..." - obviously I want to detect the
(xxx) smilie and replace with an image.
I can sort of do this using multiple lines of code like this ...
$mytext= str_replace("(w ink)", "<IMG SRC=\"wink.gif\ ">", $mytext);
$mytext= str_replace("(s mile)", "<IMG SRC=\"smile.gif \">", $mytext);
$mytext= str_replace("(l augh)", "<IMG SRC=\"laugh.gif \">", $mytext);
.... but I would prefer to find a function that could detect the (xxx) and
simply call the relevant image using a variable ... <IMG SRC="$image.gif ">
Any ideas?
Paul.
Don't know the right function to use here. I have a php file containing
text only that will contain references to smilies formatted such as "...
then I told him the punch line (wink) ..." - obviously I want to detect the
(xxx) smilie and replace with an image.
I can sort of do this using multiple lines of code like this ...
$mytext= str_replace("(w ink)", "<IMG SRC=\"wink.gif\ ">", $mytext);
$mytext= str_replace("(s mile)", "<IMG SRC=\"smile.gif \">", $mytext);
$mytext= str_replace("(l augh)", "<IMG SRC=\"laugh.gif \">", $mytext);
.... but I would prefer to find a function that could detect the (xxx) and
simply call the relevant image using a variable ... <IMG SRC="$image.gif ">
Any ideas?
Paul.
Comment