check typeof variable php

PHP
gettype($u)
Source

Also in PHP: