Page 1 of 1

text replacing oddity

Posted: Wed Feb 07, 2007 1:12 am
by s.dot
when replacing smiley codes, how does "D end up getting replaced by a smiley when the codes for that smiley are this:

Code: Select all

array(";-d",";-D",";D");
edit: I know it's kinda hard to tell without seeing code. But is it some kind of weird keyboard character thing, or is it a glitch in my code?

Posted: Wed Feb 07, 2007 1:18 am
by feyd
"D

Posted: Wed Feb 07, 2007 1:24 am
by s.dot
ah, good ol' htmlentities.

i guess i gotta remove "; D" from the list of codes to be replaced, because if i run htmlentities after replacing smileys, it will just show the <img src="smileys/...." thingy.

thanks feyd

Posted: Wed Feb 07, 2007 1:26 am
by feyd
A regular expression could help, potentially. Using a negative look-behind for example.