![]() |
another problem confuse me
hi,thank the guys solved my preceding puzzle.
now I want to know that why the result of " intval(042); " is 34 but not 42,who can tell me ? thanks , |
The number
042 is an octal number (base 8) rather than a 'normal' decimal number (base 10). It's the octal 42 which can be explained below:Octal Code:
32 16 8 18*4 + 1*2 which gives 34.Compare this to decimal numbers Code:
1000 100 10 110*4 + 1*2 which gives 42.You can also use hexadecimal (base 16) by preceding the number with 0x. For example, all of the following have an integer value of 123.PHP Code:
|
Quote:
|
| All times are GMT. The time now is 07:49 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0