check the type of the variable in php

PHP
gettype($u)
Source

Also in PHP: