tags:

views:

37

answers:

2

I am looking for light weight tool/API/script(in PHP) to validate whether a html code sippet is 'tidy'.By 'tidy' I simply mean whether the html snippet has properly closed tags and is valid html.

the tools that are usually ailable are generally for validating a url html. I wnat to be able to validate only a small html snippet . e.g

<a href="xyz.com" Click Here </a>

the above is invalid as the <a> tag does not close properly

where as

<span> my name is xyz</span>

is valid .

What would be the best way to validate html snippets? Thanks in advance for your help.

A: 

http://validator.w3.org/#validate%5Fby%5Finput

Natrium
Actually I was looking for a API or tool which I can connect to and validate some input from my server (an not actually have to post the snippet to http://validator.w3.org/#validate%5Fby%5Finput)
Annibigi
Thanks for your comments
Annibigi
that is not clear in your question
Natrium
sorry about that...but thanks for the pointers, all the same
Annibigi
A: 

W3C API

Pear Class

meanstreakuk
Thanks ..I think W3C API will work for me
Annibigi