Re: strip down Warnings

From: Date: Wed, 10 Mar 2004 13:30:45 +0000
Subject: Re: strip down Warnings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-180012@lists.php.net to get a copy of this message
On 10 Mar 2004 dmesg wrote: > How can i tell fsockopen() to skip to echo this warnings? Here's a repeat of something I just posted the other day on this ... Here's an approach I have used to avoid any error messages at all -- presumably you could also set a flag in the error handler to indicate what happened, if you need that. You need to both disable error reporting and set a "do-nothing" error handler. ..... $olderr = error_reporting(0); set_error_handler("ignoreerrhandler"); $fp = fsockopen(.....) restore_error_handler(); error_reporting($olderr); if ($fp) { [worked] } else { [failed] } ..... function ignoreerrhandler($errno, $errstr, $errfile, $errline) { return; } -- Tom

« previous php.general (#180012) next »