note 52772 added to function.tidy-get-error-buffer
| From: | david dot tulloh at infaze dot com dot au | Date: | Thu, 12 May 2005 05:42:23 +0000 |
| Subject: | note 52772 added to function.tidy-get-error-buffer | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89301@lists.php.net to get a copy of this message | ||
The following line will convert string error into a two dimensional array containing the components
from the error string for each line. It will match Error, Warning, Info and Access error types.
You can then do something useful with the output.
<?php
preg_match_all('/^(?:line (\d+) column (\d+) - )?(\S+): (?:\[((?:\d+\.?){4})]:)
?(.*?)$/m', $tidy->errorBuffer, $tidy_errors, PREG_SET_ORDER);
?>
And a small tip, always run the error messages through htmlentities when outputting to convert the
tags in the error to a viewable form.
----
Manual Page -- http://www.php.net/manual/en/function.tidy-get-error-buffer.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52772
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52772&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52772&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52772&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52772&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52772&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52772&report=yes
Search -- http://master.php.net/manage/user-notes.php