The following examples demonstrate how to get validation results from an instance of the W3C HTML Validator.
Example 64-1. Validate by URI
This is a simple example which shows how to validate a URI and return whether the page is valid or not.
require_once 'Services/W3C/HTMLValidator.php'; $v = new Services_W3C_HTMLValidator(); $u = 'http://www.unl.edu/'; $r = $v->validate($u); if ($r->isValid()) { echo $u.' is valid!'; } else { echo $u.' is NOT valid!'; }