0
001 - string or int
$smth = 001 echo $smth is the output of the example 1 or "001"? how can i define smth as string or int?
6 Antworten
+ 8
$smth = 001;
echo $smth; //prints 1
$smth = "001";
echo $smth; //prints 001
+ 1
Output is 001 and it is integer,
0
this is int
0
it is a string. if you guys think 001 is an integer then use maths here please with command + you will see output wont be 002and shouldnt be therefore it is a string
0
001 is integer only
- 2
Int is for a WHOLE NUMBER (ex: 0, 1, 2) no decimals
001 is a string