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">'); Link to comment https://forums.phpfreaks.com/topic/43601-arrays/ 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. Link to comment https://forums.phpfreaks.com/topic/43601-arrays/#findComment-211769 Share on other sites More sharing options...
jitesh Posted March 21, 2007 Share Posted March 21, 2007 Wrong post Link to comment https://forums.phpfreaks.com/topic/43601-arrays/#findComment-211817 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. Link to comment https://forums.phpfreaks.com/topic/43601-arrays/#findComment-212007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.