Re: Catch PHP warning message into PHP variable???
| From: | Michael Wallner | Date: | Wed, 07 Apr 2004 14:13:54 +0000 |
| Subject: | Re: Catch PHP warning message into PHP variable??? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11698@lists.php.net to get a copy of this message | ||
Hi Scott Fletcher, you wrote:
> I wanted to know is how to catch the PHP warning message that get
> displayed to the screen, how to catch it and put it into the variable.
ini_set('track_errors', true);
if (!is_resource($fh = @fopen('/nonexistent', 'r')) {
echo "Uh-Oh, catched an error: $php_errormsg\n";
}
Regards,
--
Michael - < mike(@)php.net >
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc