0
PHP data type
i am new in php . earlier in this , they said php doesn't need to declare variable because it automatically understand the data type. then why there are data types??
2 Antworten
0
$hello = "hello world";
is a string type
$age = 21;
is an int
$letter = 'a';
is a char
and so on...
0
so the question is WHY?
Later is usefull to know how you have to deal with some result.
lets say that you get a date-time. did you get a string or integrer or something else? . is not the the same add 2 integrers than adding 2 strings.