php get type of object
snippet in php

php get variable type

user383


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

user8679

gettype($u)

php get type of object

user476

gettype($object);