writing binary data to file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,
I must change some bytes in array filled from a msssql text field; now I do:
function adjust (&$ar_in) {
    $ar_in{0}='Ð';
    $ar_in{1}='Ï';
    $ar_in{3}='à';
    $ar_in{4}='¡';
    $ar_in{5}='±';
    $ar_in{7}='á';
}

I've copied/pasted values from an hex editor and this works ok. Question is: does exists a more elegant way to do this, using directly hex values in the script?
I tried $ar_in{0}=0xFF for example, but when I write on file I got hex 32 (ascii '2').


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux