SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Oct 27, 2009, 03:58 #1
- Join Date
- Mar 2009
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
looking for light weight tool/API/script(in PHP) to validate whether a html code snip
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
HTML Code:<a href="xyz.com" Click Here </a>
HTML Code:<a>
where as
HTML Code:<span> my name is xyz</span>
What would be the best way to validate html snippets? Thanks in advance for your help.
-
Oct 27, 2009, 04:49 #2
- Join Date
- Jan 2009
- Location
- Wiltshire, UK
- Posts
- 125
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You might want to take a look at http://php.net/manual/en/book.tidy.php
Best Regards, George
-
Oct 27, 2009, 04:49 #3
- Join Date
- Aug 2009
- Posts
- 122
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can find a source code of the official validator.w3.org validator at http://validator.w3.org/source/ It is not written in PHP, but might give you some ideas.
Bookmarks