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??

23rd Jan 2017, 3:18 PM
Refat Khan Pathan
Refat Khan Pathan - avatar
2 Antworten
0
$hello = "hello world"; is a string type $age = 21; is an int $letter = 'a'; is a char and so on...
23rd Jan 2017, 3:51 PM
Uran Kajtazaj
Uran Kajtazaj - avatar
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.
24th Jan 2017, 8:21 PM
braulio bracamonte
braulio bracamonte - avatar