ever tryed telling PHP to display the variable as an integer?
echo (integer) $id ;
-- red
Daniel Clark wrote:
Doesn't putting and x000011 tell PHP it's a decimal format?
$id = 000011; $id2 = preg_replace("/^0+(.*)$/","\\1",$id);
echo $id2; // Displays 9 echo $id; // Displays 9 as well.
If the number begins with a zero, there seems to be no way to tell PHP this is an integer, not an octal. The conversion happens as soon as the number is stored in the variable, it appears, which is why everything done afterwards makes no difference, because $id=000011; seems to be stored as $id=>9 by PHP.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php