PHP offer a very useful build-in function gettype() where you can use to check the php variable datatype. Example:
<?php $int = 1; echo gettype($int); //integer $array = array(1,2,3); echo gettype($array); //array $string = "DEV"; echo gettype($string); //string ?>