Re: [PHP] ill sprintf() behavior w/ HEX type

2002-11-21 Thread Chris Wesley
On Thu, 21 Nov 2002, Jason Wong wrote: > That's because it's expecting a _decimal_ and will automatically convert it to > hex for you. AH! Must've been a longer day than I thought ... dunno how that escaped me. Somehow I was reading "x - the argument is treated as in integer and presented as a

Re: [PHP] ill sprintf() behavior w/ HEX type

2002-11-21 Thread Jason Wong
On Thursday 21 November 2002 15:51, Chris Wesley wrote: > Using PHP/4.2.2 & Apache/1.3.26 on Linux 2.4.17 > > I'm trying to format a HEX value into an 8-byte string, that is > zero-padded to the left, using sprintf(). Simple enough. > > $sprintf( "%08x", "fa23d" ); > This should return "000fa23d".

[PHP] ill sprintf() behavior w/ HEX type

2002-11-20 Thread Chris Wesley
Using PHP/4.2.2 & Apache/1.3.26 on Linux 2.4.17 I'm trying to format a HEX value into an 8-byte string, that is zero-padded to the left, using sprintf(). Simple enough. $sprintf( "%08x", "fa23d" ); This should return "000fa23d". But it returns "". Since that doesn't work, I'm using thi