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: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.