Re: [PHP-DEV] fread/fwrite and binary data From: Stanislav Malyshev (stas <email protected>)
Date: 09/17/00

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 <email protected>  http://www.zend.com/        
+972-3-6139665 ext.106

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>