Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

[PHP] Re: How put hex value into file? From: _lallous (elias_bachaalany <email protected>)
Date: 09/28/01

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 <email protected>> wrote in message
news:6293562776.20010928132827 <email protected>
> 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 <email protected>
>
>

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