detect the datatype of a value php

PHP
gettype($u)
Source

Also in PHP: