PHP code example of beutnagel / doctype-validator

1. Go to this page and download the library: Download beutnagel/doctype-validator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

beutnagel / doctype-validator example snippets


$dtv = new Doctype_Validator();

$doctype = "<!DOCTYPE html>";


$valid = $dtv->validate($doctype)->isValid();

$match = $dtv->validate($doctype)->isMatch();

$matches = $dtv->validate($doctype)->matches();

$error = $dtv->validate($doctype)->hasError();

$result  = $dtv->validate($doctype);
if($result->hasErrors())
{
  $errors = $result->getErrors();
}

$fragments = $dtv->validate($doctype)->getFragments();