check type of var in php

PHP
gettype($u)
Source

Also in PHP: