Examples

Examples – Using Services_W3C_HTMLValidator

Getting results from the HTML Validator

The following examples demonstrate how to get validation results from an instance of the W3C HTML Validator.

Validate by URI

This is a simple example which shows how to validate a URI and return whether the page is valid or not.

<?php
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!';
}
?>
Introduction to Services_W3C_HTMLValidator (Previous) Services_Weather (Next)
Last updated: Tue, 30 Sep 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.