Displaying the Type of a Variable : gettype « Reflection « PHP






Displaying the Type of a Variable

 
<html>
<body>
<div>
<?php
    $testing; // declare without assigning
    print gettype( $testing ); 
    print "<br />";
    $testing = 5;
    print gettype( $testing ); 
    print "<br />";
    $testing = "five";
    print gettype( $testing ); 
    print "<br />";
    $testing = 5.0;
    print gettype( $testing ); 
    print "<br />";
    $testing = true;
    print gettype( $testing ); 
    print "<br />";
?>
</div>
</body>
  
  








Related examples in the same category

1.Creating an object from the Cat class