PHP:Data-type of variable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

PHP:Data-type of variable

Does PHP have any inbuilt function which gives the data type of variable

7th Sep 2017, 6:14 PM
Nitin G Dagaya
Nitin G Dagaya - avatar
2 Answers
+ 4
You can use the function gettype(). Example (PHP): $the_Variable = "Theory"; echo gettype($the_Variable); # Outputs string
7th Sep 2017, 6:19 PM
Ghauth Christians
Ghauth Christians - avatar
+ 1
Thanks mate
8th Sep 2017, 4:30 PM
Nitin G Dagaya
Nitin G Dagaya - avatar