Re: Hiding warnings




deciacco wrote:
I'm using the DOMDocument::loadHTML() method and it throws some
warnings:

DOMDocument::loadHTML() [function.loadHTML]: htmlParseEntityRef:
expecting ';' in Entity, line: 579

DOMDocument::loadHTML() [function.loadHTML]: Unexpected end tag : b in
Entity, line: 24

I believe these warnings are due to the loose formating of HTML so at
this point I'm not worried about them. (should I be?) I can use an
.htaccess file or settings in php.ini to hide these warnings, but I was
wondering if there was a better way. I was thinking I could use
error_reporting() to change the level before the loadHTML function and
then set it back. Any thoughts or suggestions?

Thanks!!

Use the @ operator, it supresses all errors related from the statement.

@implode("foo", "bar"); won't give any warnings, errors, notices, etc.
It also affects subcalls (so a function within a function won't display
errors).

This also means that @include('file'); won't display parse errors,
it'll just die silently.

.



Relevant Pages

  • Re: A toughy.
    ... Do I ignore all those warnings and using add and remove just delete the darned thing? ... I have always used HTML for my personal posts and the HTML doesn't seem to ... Bug 2. ... Paying users do not have this message in their emails. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Variable remaining undef in one place but not another.
    ... the cwd on to part that starts the HTML, so that the cwd can be used in ... the HTML title tag. ... use warnings; ... sub htmlStart{ ...
    (comp.lang.perl.misc)
  • Re: backreferneces in search pattern
    ... Unless you control the layout of the HTML, you would be much better off ... > I am labouring since a long while already on this filter. ... because of the additional control over the warnings it affords. ... The uninitialized value might have come from a capturing parentheses ...
    (comp.lang.perl.misc)
  • Re: converting linebreaks to br
    ... > Level of HTML: HTML 4.01 Transitional ... Uncheck the "Include warnings" checkbox ... But, without fail, such markup doesn't mean what the author thought ... The reason for the trailing ">" is because HTML permits shorthand ...
    (comp.lang.php)
  • Re: DocumentHTML ?
    ... automated downloading of about 10 GB of HTML from various web sites ... use warnings; # do not leave it out. ... to set your security settings to a low and possibly unsafe level. ...
    (comp.lang.perl.misc)