note 10030 deleted from function.fopen by nlopess
| From: | nlopess@php.net | Date: | Sat, 03 Apr 2004 14:32:42 +0000 |
| Subject: | note 10030 deleted from function.fopen by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67564@lists.php.net to get a copy of this message | ||
Note Submitter: paul_tanner@alum.mit.edu
----
Be careful how you test for errors from fopen(). The familiar construction:
$out=fopen("file","w") || die ("file won't open");
is a great way NOT to create a working filehandle. Test instead with an if as in the note above.
The || has the effect of overwriting the filehandle and rendering it useless.
--
editors note: use 'or' instead of '||'