note 89106 deleted from function.is-object by danbrown
| From: | danbrown@php.net | Date: | Sun, 22 Feb 2009 00:32:21 +0000 |
| Subject: | note 89106 deleted from function.is-object by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150939@lists.php.net to get a copy of this message | ||
Note Submitter: fortune at teamweb3 dot com
----
/*Created By Fortune Vieyra*/
/*----Javascript typeof in PHP ------*/
function typeof($x)
{
if(is_bool($x)){$type='bool';}
else if(is_callable($x)){$type='callable';}
else if(is_double($x)){$type='double';}
else if(is_float($x)){$type='float';}
else if(is_int($x)){$type='int';}
else if(is_integer($x)){$type='integer';}
else if(is_long($x)){$type='long';}
else if(is_null($x)){$type='null';}
else if(is_numeric($x)){$type='numeric';}
else if(is_object($x)){$type='object';}
else if(is_real($x)){$type='real';}
else if(is_resource($x)){$type='resource';}
else if(is_scalar($x)){$type='scalar';}
else if(is_string($x)){$type='string';}
else{$type=false;}
return $type;
}