semtex Posted May 20, 2006 Share Posted May 20, 2006 I'm using the xhtml strict doctype:[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> [/code]As I'm making a database driven website with PHP and MySQL, there's often special characters appearing in my XHTML that are not validating. I'm thinking of a character like "&" (should be "&")What's the best way to solve this? I mean I can't use php's htmlentities() function on every echoed text, can I? Link to comment https://forums.phpfreaks.com/topic/10079-php-xhtml-strict-and-special-characters/ Share on other sites More sharing options...
zq29 Posted May 20, 2006 Share Posted May 20, 2006 [!--quoteo(post=375563:date=May 20 2006, 09:23 PM:name=semtex)--][div class=\'quotetop\']QUOTE(semtex @ May 20 2006, 09:23 PM) [snapback]375563[/snapback][/div][div class=\'quotemain\'][!--quotec--]What's the best way to solve this? I mean I can't use php's htmlentities() function on every echoed text, can I?[/quote]You can, although what I do is just type the entities instead of the actual character - Just a matter of habit now...[code]<?phpecho "I really fancy some tea & crumpets!";?>[/code] Link to comment https://forums.phpfreaks.com/topic/10079-php-xhtml-strict-and-special-characters/#findComment-37494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.