Using an is_ function to determine a proper data type : is_string « Reflection « PHP






Using an is_ function to determine a proper data type

 
<?php 
    $unknownvar = "asdf"; 
    echo gettype ($unknownvar) . "<br />"; 
    if (is_string ($unknownvar)){ 
        echo "Is a string<br />"; 
    } 
?>
  
  








Related examples in the same category

1.Using is_ function to determine a proper data type and then work with it