By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,192 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,192 IT Pros & Developers. It's quick & easy.

Hiding warnings

P: n/a
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!!

Jul 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

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.

Jul 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.