Mega Code Archive

 
Categories / Php / Data Type
 

Changing Type with settype()

<html> <body> <div> <?php     $undecided = 3.14;     print gettype( $undecided );      print " -- $undecided<br />";     settype( $undecided, string );     print gettype( $undecided );      print " -- $undecided<br />";     settype( $undecided, int );     print gettype( $undecided );      print " -- $undecided<br />";     settype( $undecided, double );     print gettype( $undecided );      print " -- $undecided<br />";     settype( $undecided, bool );     print gettype( $undecided );      print " -- $undecided<br />"; ?> </div> </body> </html>