Why is this so:
when I do this :
it returns 896PHP Code:echo 001600;
![]()
| SitePoint Sponsor |
Why is this so:
when I do this :
it returns 896PHP Code:echo 001600;
![]()
Don't Panic

My guess would be PHP is reading that as a pre defined variable in the PHP core
any solution for this?
$a = '009699';
if ($a > 001600){
return true;
}
Don't Panic




Simple answer here, when you prefix a number with 0, php interprets it as an octal number (base 8), when you print it it gets converted to decimal. Remove the prefixed zeroes and it will work.
Bookmarks