+ 2
Hi, Why the output is 24, step by step write please?
<? php echo intval ('30', 8); ? >
5 Antworten
+ 5
EGO it's decimal to octal conversion where
$var is first statement which is $var is the scalar value being converted to an integer and second value is the base for the conversion
as there is no 0 or 0X in the intval('30',8) that shows the given string is given in decimal and we want to convert it in the octal as written in intval()
<?php
$var = "30";
echo intval($var)."\n".intval($var, 8);
?>
So in this decimal to octal conversion is perform on 30
So 30= 3×8^1 + 0×8^0 = 24+0=24 so output is 24
+ 3
egxcuse me, there's quotes needed
on 30.
+ 3
Thank You very much, STEASY_:-)
+ 1
My Output is 30....
Is there any extra code?
0
🤔