Re: How put hex value into file?
| From: | _lallous | Date: | Fri, 28 Sep 2001 11:54:23 +0000 |
| Subject: | Re: How put hex value into file? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69152@lists.php.net to get a copy of this message | ||
write it as a string:
$fs=fopen($file,"wb");
$info="0x10100000"
fputs($fs,$info);
fclose($fs);
or use the sprintf() with the "%x" modifier.
"Andris Jancevskis" <ajandris@parks.lv> wrote in message
news:6293562776.20010928132827@parks.lv...
> Hi!
>
> I want to insert hex value into file (not decimal value in hex).
> Code below doesn't work (it inserts 269484032). I'm puzzled.
>
> $fs=fopen($file,"wb");
> $info=0x10100000;
> fputs($fs,$info);
> fclose($fs);
>
> I want put into this file ASII characters too.
> gettype says that $info is an integer.
>
> Thanx,
> Andris
> mailto:ajandris@parks.lv
>
>