変数操作関数 2016年11月03日 12:33   編集
変数の型を取得する

得られる返り値は
"boolean" "integer" "double"("float"ではなくdoubleとなる) "string" "array" "object" "resource" "NULL" "unknown type"
$a = date_create();
$b = '';
$c = '14';
$d = $c *1;
$e = $c / 3;
echo gettype($a) . "\n";
echo gettype($b) . "\n";
echo gettype($c) . "\n";
echo gettype($d) . "\n";
echo gettype($e) . "\n";
実行結果
object
string
string
integer
double
counter:2,774