Re: fread/fwrite and binary data
| From: | Stanislav Malyshev | Date: | Sun, 17 Sep 2000 10:43:58 +0000 |
| Subject: | Re: fread/fwrite and binary data | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-33376@lists.php.net to get a copy of this message | ||
c>> $binary_value = 0x0c;
c>>
c>> echo gettype($binary_value) . "\n";
c>> printf("0x%02x\n", $binary_value);
c>>
c>> $fh = fopen(TEST_FILE, "wb"); /* b is ignored under UNIX */
c>> fwrite($fh, $binary_value); /* always converts to string... */
I guess you should use sprintf or pack here if you really want to work
with binary data.
--
Stanislav Malyshev stas@zend.com http://www.zend.com/
+972-3-6139665 ext.106