note 48175 deleted from function.fwrite by betz
| From: | betz@php.net | Date: | Wed, 15 Dec 2004 22:08:45 +0000 |
| Subject: | note 48175 deleted from function.fwrite by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81837@lists.php.net to get a copy of this message | ||
Note Submitter: Lobster
----
Concerning ceilingfish's post below:
Whereas fwriting a blank string returns 0, a failed fwrite returns FALSE. This can be distinguished
by using === as in the example in the main documentation. (To avoid confusion, I added a missing
bracket too)
Thus, the code posted should read:
<?php
$blank = '';
if(fwrite($somefilehandle,$blank,strlen($blank)) === FALSE)
{
die 'Some write error';
}
else
{
echo "'$hi' written to file";
}
?>