note 36646 added to function.fopen
| From: | youngsoo at freechal dot com | Date: | Fri, 17 Oct 2003 05:29:55 +0000 |
| Subject: | note 36646 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58745@lists.php.net to get a copy of this message | ||
When treating binary mode file in PHP,
is it impossible to create and write binary mode file?
I can see many examples how to read binary file like image,
but It dosen't work write.
for example
<?
$data = "I am a boy.";
$length = strlen($data);
$fp = fopen("./temp_binary.dat", "wb");
fwrite($fp,$data,$length);
fclose($fp);
?>
At above script, generated file mode is not binary, but text.
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36646
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36646&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36646&report=yes
Search -- http://master.php.net/manage/user-notes.php