• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[PHP] Outputting Valid HTML

vern

Dominus
Political User
#1
Is there a script or function out there that checks and replaces what would otherwise be just plain and possibly not valid HTML into valid HTML?
 

Khayman

I'm sorry Hal...
Political User
#2
easily? no since valid html would depend on which standard you used.

You could make some nice regular expression checks to make sure each tag has a closing tag and such
 

SPeedY_B

I may actually be insane.
#3
You'd need to include the entire HTML (or XHTML) specification that you're going to be using in a rather large PHP class and check the code for anything which doesn't follow the rules.

It'd be a rather large job, and I've never come across a script which does it. I'd just stick with the w3 Validator and their HTML Tidy application. Both can be found on http://w3.org/ if I recall.
 

vern

Dominus
Political User
#5

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,014
Latest member
sanoravies