I tried the following and it didn't work:

<?
$i = base64_decode("\0\0\0A"); // I also tried
                               // $i = base64_decode("\0\0\0\0x41")
                               // and it didn't work either.
echo "***$i***\n";
?>


X-Powered-By: PHP/4.1.2 Content-type: text/html

******

It was supposed to output:

***65***

[EMAIL PROTECTED] wrote:
http://us4.php.net/manual/en/function.base64-decode.php


-----Original Message----- From: Julio Sergio Santana <[EMAIL PROTECTED]> Sent: Jul 8, 2004 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] How can I write/read encoded numbers into/from a file?

I'm just starting with PHP, and I've been browsing the whole manual to find how to solve the following problem:

1. An integer number is internally represented in 4 bytes. Say, for instance, number 65 is represented by 0x00000041, that is the string "\0\0\0\0x41", and not the string "65".
2. How can I write this representation into a file and then read back it from the file?


Do you have any idea about this?

Thank you,


Sergio.


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



Reply via email to