tidy::getStatus

(PHP 5, PHP 7, PECL tidy >= 0.5.2)
Get status of specified document
int tidy::getStatus ( void )

Object oriented style

Procedural style

int tidy_get_status ( tidy $object )

Returns the status for the specified tidy object.

Parameters:
object

The Tidy object.

Returns:

Returns 0 if no error/warning was raised, 1 for warnings or accessibility errors, or 2 for errors.

Examples:
tidy::getStatus() example
<?php
$html = '<p>paragraph</i>';
$tidy = new tidy();
$tidy->parseString($html);

$tidy2 = new tidy();
$html2 = '<bogus>test</bogus>';
$tidy2->parseString($html2);

echo $tidy->getStatus(); //1

echo $tidy2->getStatus(); //2
?>

doc_php
2016-02-24 16:07:04
Comments
Leave a Comment

Please login to continue.