note 78381 added to function.gettype
| From: | support at wifilinx dot com | Date: | Tue, 09 Oct 2007 17:06:02 +0000 |
| Subject: | note 78381 added to function.gettype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131249@lists.php.net to get a copy of this message | ||
<?php
/*This is a javascript like typeof function that takes the place of is_...*/
function typeof($x){$type = is_ binary($x)?'binary':is_ bool($x)?'bool':is_
buffer($x)?'buffer':is_ callable($x)?'callable':is_
double($x)?'double':is_ float($x)?'float':is_ int($x)?'int':is_
integer($x)?'integer':is_ long($x)?'long':is_ null($x)?'null':is_
numeric($x)?'numeric':is_ object($x)?'object':is_ real($x)?'real':is_
resource($x)?'resource':is_ scalar ($x)?'scalar':is_ string
($x)?'string':is_ unicode($x)?'unicode':false; return $type;}
//i.e
$something = array();
echo typof($something); //returns array
?>
----
Server IP: 69.147.83.197
Probable Submitter: 76.193.143.244
----
Manual Page -- http://www.php.net/manual/en/function.gettype.php
Edit -- https://master.php.net/note/edit/78381
Del: integrated -- https://master.php.net/note/delete/78381/integrated
Del: useless -- https://master.php.net/note/delete/78381/useless
Del: bad code -- https://master.php.net/note/delete/78381/bad+code
Del: spam -- https://master.php.net/note/delete/78381/spam
Del: non-english -- https://master.php.net/note/delete/78381/non-english
Del: in docs -- https://master.php.net/note/delete/78381/in+docs
Del: other reasons-- https://master.php.net/note/delete/78381
Reject -- https://master.php.net/note/reject/78381
Search -- https://master.php.net/manage/user-notes.php