On Thu, 2002-05-23 at 14:24, Jose Jeria wrote:
> I am new to PHP and I have a simple question about fopen
> 
> For example:
> $tmp = fopen("testfile.txt", "r");
> 
> If the file is not found i get an error. ("No such file or directory")
> So there is no point in checking for this like this:
> 
> if($tmp) // statements
> 
> Am I doing something wrong here?

No.  But if you want to suppress that error message, use a @ character
in front of the fopen:

if ($tmp = @fopen("testfile.txt", "r")) {
}

Please post questions like this to [EMAIL PROTECTED] in the
future.

 - Stig


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to