This exercise creates a variable called "testing", then it assigns the variable different values, and tests the type of the variable with each value.
An answer of "1" means it's true (it is a variable of that type); no answer means it is false (it is not a variable of that type).
$testing; // declare type without assigning it a type
echo "<br />";
echo "The variable 'testing' has been declared but not assigned a value.";
echo "<br />";
echo "1. Is variable type 'null'? ".is_null($testing); // checks if type is "null"
echo "<br />";
$testing = 5;
echo "<br />";
echo "The variable 'testing' has been assigned the value 5.";
echo "<br />";
echo "2. Is variable 'testing' an integer? ".is_int($testing); // checks if type is "int"
echo "<br />";
$testing = "five";
echo "<br />";
echo "Variable 'testing' has now been changed to \"five\".";
echo "<br />";
echo "3. Is variable 'testing' a string? ".is_string($testing); // checks if string
echo "<br />";
$testing = 5.024;
echo "<br />";
echo "Variable 'testing' has now been changed to 5.024.";
echo "<br />";
echo "4. Is variable 'testing' a double? ".is_double($testing); // checks if double
echo "<br />";
$testing = true;
echo "<br />";
echo "Variable 'testing' has now been changed to true.";
echo "<br />";
echo "5. Is variable 'testing' boolean? ".is_bool($testing); // checks if boolean
echo "<br />";
$testing = array('apple', 'orange', 'pear');
echo "<br />";
echo "Variable 'testing' has now been changed to array('apple', 'orange', 'pear').";
echo "<br />";
echo "6. Is variable 'testing' an array? ".is_array($testing); // checks if array
echo "<br />";
echo "7. Is variable 'testing' numeric? ".is_numeric($testing); // checks if is numeric
echo "<br />";
echo "8. Is variable 'testing' a resource? ".is_resource($testing); // checks if is resource
echo "<br />";
echo "9. Is variable 'testing' an array? ".is_array($testing); // checks if is an array
echo "<br />";