...

View Full Version : Escaping "&" "<" ">" from DB data



DHTML Kitchen
03-31-2004, 04:22 PM
Hi,

Anyone got a good function for filtering HTML illegal characters?

I need an escape and unescape for entities so I can get from db and call do db using raw ascii chars, but present the data with entities.

Az`
03-31-2004, 04:52 PM
You might be looking for

htmlspecialchars()

It will convert characters into their html equivalents - So > becomes &gt;

Edit: Bit of browsing returns: http://uk.php.net/manual/en/function.htmlentities.php

DHTML Kitchen
03-31-2004, 10:51 PM
htmlentities()
html_entity_decode()



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum