Catch warnings
| From: | Mariano Guadagnini | Date: | Tue, 15 Nov 2005 19:39:05 +0000 |
| Subject: | Catch warnings | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-225865@lists.php.net to get a copy of this message | ||
Hi, i´m writting a php program that parses and saves some xml files on a server. The problem is that i want to catch warnings so as to be able to store them in a variable, but not to be put directly on client´s browser. I got the following code, but i cannot get it working:
//--------------------------------------------------------
$old_track = ini_set('track_errors', '1');
if (!@somefunction()) {
echo $php_errormsg, "\n";
}
ini_set('track_errors', $old_track);
//--------------------------------------------------------
When i execute the cgi, the $php_errormsg variable is always empty, even when there are errors.
Any ideas?
Thanks in advance,
Mariano Guadagnini
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.1/169 - Release Date: 15/11/2005