Mega Code Archive

 
Categories / Php / Reflection
 

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>