Html karakters omzetten
Weet iemand of php een functie heeft om alle html karakters zoals & < > etc. omzet naar & < > etc?
Ik kan er zelf wel een maken maar als php al zo'n functie heeft..
Ik kan er zelf wel een maken maar als php al zo'n functie heeft..
Beetje lui? Php.net heeft alle info.
htmlentities() en htmlspecialchars().
htmlentities() en htmlspecialchars().
Gewijzigd op 01/01/1970 01:00:00 door - SanThe -
htmlspecialchars
(PHP 4, PHP 5)
htmlspecialchars — Convert special characters to HTML entities
The translations performed are:
* '&' (ampersand) becomes '&'
* '"' (double quote) becomes '"' when ENT_NOQUOTES is not set.
* ''' (single quote) becomes ''' only when ENT_QUOTES is set.
* '<' (less than) becomes '<'
* '>' (greater than) becomes '>'
(PHP 4, PHP 5)
htmlspecialchars — Convert special characters to HTML entities
The translations performed are:
* '&' (ampersand) becomes '&'
* '"' (double quote) becomes '"' when ENT_NOQUOTES is not set.
* ''' (single quote) becomes ''' only when ENT_QUOTES is set.
* '<' (less than) becomes '<'
* '>' (greater than) becomes '>'
Ahh foutje van mij. Firebug conventeert ze weer terug als ik in de broncode kijk via firebug zie je gewoon & staan. Wat stom haha.




