RE: [PHP] Strange Numeric Conversion...

From: Date: Fri, 02 Apr 2004 21:38:03 +0000
Subject: RE: [PHP] Strange Numeric Conversion...
Groups: php.general 
Request: Send a blank email to php-general+get-182195@lists.php.net to get a copy of this message
[snip] Why is this happening??? $id = 000011; echo $id; // Displays: 9 $id = 11; echo $id; // Displays: 11 How do I make the first number (00011) display as 11? Why is it showing 9? [/snip] First of all you have "naked" numbers. The first one, 000011, looks like a binary number (which actually should be 3). You are going to have to trim the leading zero's from the number to have it display as 11.

« previous php.general (#182195) next »