note 119656 added to function.fwrite

From: Date: Wed, 27 Jul 2016 02:01:18 +0000
Subject: note 119656 added to function.fwrite
Groups: php.notes 
Request: Send a blank email to php-notes+get-206113@lists.php.net to get a copy of this message
This may save you time: note that neither "binary-safe file write" nor the use of b mode in fopen mean that fwrite can write binary. It can only write strings (or a single character). For example, attempting to write the byte 0x1 using fwrite results in writing the byte value 0x31. If you wish to write binary values (bits, bytes, integers, etc.), use a statement like fprintf($Res, "%c", 0x1); . This statement will write a byte to the current offset in the file without converting it to a character (in this case, it will write 0x1). ---- Server IP: 72.52.91.14 Probable Submitter: 74.75.134.218 ---- Manual Page -- http://php.net/manual/en/function.fwrite.php Edit -- https://master.php.net/note/edit/119656 Del: integrated -- https://master.php.net/note/delete/119656/integrated Del: useless -- https://master.php.net/note/delete/119656/useless Del: bad code -- https://master.php.net/note/delete/119656/bad+code Del: spam -- https://master.php.net/note/delete/119656/spam Del: non-english -- https://master.php.net/note/delete/119656/non-english Del: in docs -- https://master.php.net/note/delete/119656/in+docs Del: other reasons-- https://master.php.net/note/delete/119656 Reject -- https://master.php.net/note/reject/119656 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206113) next »