Unholy Prayer Posted March 21, 2007 Share Posted March 21, 2007 I am trying to make an emoticon script but I can't use a parentheses in my text code. For example, "" won't work because the parentheses creates a syntax error. How do I make it so I can use a parentheses in an array? This is my code: $ecodes= array(''); $images = array('<img src='images/emoticons/sad.gif">'); Quote Link to comment Share on other sites More sharing options...
btherl Posted March 21, 2007 Share Posted March 21, 2007 Check the line number of your error.. it's actually because you used ' in the second line instead of " for the img src attribute. Quote Link to comment Share on other sites More sharing options...
jitesh Posted March 21, 2007 Share Posted March 21, 2007 Wrong post Quote Link to comment Share on other sites More sharing options...
per1os Posted March 21, 2007 Share Posted March 21, 2007 $ecodes= array(''); $images = array('<img src="images/emoticons/sad.gif">'); You had the wrong quote in the img tag, needed to be double not single.. Try that. Some food for thought, you could do it this way instead. $ecodes= array('' => '<img src="images/emoticons/sad.gif">'); //$images = array('<img src="images/emoticons/sad.gif">'); That way you only need one array and it is indexed by the emoticon value. 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.