Generating Valid w3c html from data in DB using PHP
Hi
I have a serious problem with a load of data that is in my db.
I have a serious problem with a load of data that is in my db.
In a lot of the Db fields there is HTML such as < and > together with &
I am extracting this data fine however, when it renders it is NOT valid HTML and is falling over on the w3c check with errors and warnings like below:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
So my question is how can i extract these characters and render in valid way so as to pass validation check?
Really hope someone can help with this as have been up half the night trying to sort with no progress.
Cheers
Steve
View full post on Tycoon Talk
Data, from, generating, Html, Using, valid