Suppose I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what's the problem?
Answer Posted / Rohit Kumar Maddeshiya
In PHP, '0123' is treated as an octal number (base 8). If you want to assign the decimal value 123 to a variable, use '123'. To display an octal number, prefix it with a zero like: <?php $octal = 0123; echo $octal; ?>
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers