List Info

Thread: note 78381 added to function.gettype




note 78381 added to function.gettype
user name
2007-10-09 12:06:02
<?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 -- htt
p://www.php.net/manual/en/function.gettype.php
Edit        -- https://master
.php.net/note/edit/78381
Del: integrated  -- h
ttps://master.php.net/note/delete/78381/integrated
Del: useless     -- http
s://master.php.net/note/delete/78381/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/78381/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78381
Reject      -- https://mast
er.php.net/note/reject/78381
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )