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 / Sukveer Singh Aswal
The issue is that the sequence 0123 is treated as an octal (base-8) number in PHP. To assign the decimal (base-10) value of 123 to a variable, use '0123' enclosed in quotes:
```php
$myVar = '0123';
echo $myVar; // outputs 123
```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is nan value?
What does $_ post mean in php?
Can anyone explain about join?
What is php key?
explain php variable length argument function.
what are the differents between 'action' and 'target' in form tag?
What are soundex() and metaphone() functions in php?
What is the use of return in php?
Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?
What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?
Can anybody plz tell me if there any recruitment on php plz mail to vasudev.adepu@gmail.com.i had completed M.SC(MATHS) in 2007 . trying to get a job on php. i have good knowledge on PHP/MYSQL
What is the use of hooks?