Page 1 of 1

Getting the actual error code for file operations

Posted: Tue Dec 09, 2003 10:15 pm
by costas
Assume the example:

$myFile = fopen("foo.txt","r");

If this returns false, how can I check what the reason for the error is? Is there an error type object or method like in VB?

I am actually programming in Linux RH9 and version 4.?? of PHP.

Thanks

Posted: Wed Dec 10, 2003 4:35 am
by Weirdan
may be this will be of help:
PHP manual wrote: The previous error message: $php_errormsg
$php_errormsg is a variable containing the text of the last error message generated by PHP. This variable will only be available within the scope in which the error occurred, and only if the track_errors configuration option is turned on (it defaults to off).