Language Basics Php



Changing the type of a variable with settype()


$undecided = 3.14;
print gettype( $undecided ); 
print " -- $undecided
";  
settype( $undecided, string );
print gettype( $undecided ); 
print " -- $undecided
";  
settype( $undecided, integer );
print gettype( $undecided ); 
print " -- $undecided
";  
settype( $undecided, double );
print gettype( $undecided ); 
print " -- $undecided
";  
settype( $undecided, boolean );
print gettype( $undecided ); 
print " -- $undecided
";  
 ?>