text replacing oddity

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

text replacing oddity

Post 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?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

"D
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

A regular expression could help, potentially. Using a negative look-behind for example.
Post Reply