note 10030 added to fopen
| From: | paul_tanner at alum dot mit dot edu | Date: | Fri, 08 Dec 2000 08:25:10 +0000 |
| Subject: | note 10030 added to fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8524@lists.php.net to get a copy of this message | ||
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.
http://www.php.net/manual/function.fopen.php