views:

196

answers:

2

Hey, is there any built in functions or something like that in php that will allow me to turn HTML special code like: <(;), >(;), Á(;) and ©(;) etc... into <, >, Á and ©

Lets say I have the value:

$fileName = "Gibt es eine schö(;)ne Offroadstrecke? (;)";

And I want this:

$fileName = "Gibt es eine schöne Offroadstrecke? ";

Any easy way to do this with php? The first I though of was to make a function that hard codes replaceing all of the HTML, search each string for the codes and replace but that is a whole lot of code in the end. :)

+1  A: 

Is there a reason you can't simply do a RegEx (or some other tool) to search and replace for "(;)" ?

Dalin Seivewright
+4  A: 

I think you want html_entity_decode

Ben
You can use '\' to escape underscores, e.g. html\_entity\_decode
ChrisW
Excellent! Thanks Chris.
Ben
Yep thats it... Thanks :D
suxSX