check var type php

PHP
gettype($u)
Source

Also in PHP: