php get variable type
snippet in php

php get variable type

user533


<?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>";
?>
 

find type in php

user4975

gettype($u)

check type in php

user9954

gettype ( mixed $var ) : string