arrays and parenthesis
Posted: Thu Apr 07, 2005 4:11 am
how can I use a parenthesis in an array?
I tried using this:
the message still comes out on the users end as ": )" instead of the image. Probably because I am using htmlentities() on the message string.
So, I tried this.
that throws me out an error
I know my arrays are correct, and this does work because simple smilies like ":s" show up as the image.
how can I have parenthesis in my arrays without them messing up the array/or coming out as plain text when I try to str_replace them with an image?
feyd | Please review how to post code using
I tried using this:
Code: Select all
$lp = "(";
$rp = ")";
$smiliesarray = array(":-$rp");
$imgarray = array("<img src=smilies/smil.gif");
str_replace($smiliesarray, $imgarray, $message);So, I tried this.
Code: Select all
$lp = "&41;";
$rp = "&42;";
// same code here as aboveI know my arrays are correct, and this does work because simple smilies like ":s" show up as the image.
how can I have parenthesis in my arrays without them messing up the array/or coming out as plain text when I try to str_replace them with an image?
feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]