Albert
0
Q:

php get variable type


<?php

  $a = 3;
echo gettype($a) . "<br>";

$b = 3.2;
echo 
  gettype($b) . "<br>";

  
$c = "Hello";
echo gettype($c) . "<br>";

$d = array();
echo 
  gettype($d) . "<br>";

$e = array("red", "green", "blue");
echo 
  gettype($e) 
  . "<br>";

$f = NULL;
echo gettype($f) . "<br>";

  
$g = false;
echo gettype($g) . "<br>";
?>
 
7
gettype($u)
12
gettype ( mixed $var ) : string
1

New to Communities?

Join the community