Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Changing the Type of a Variable with settype()

Mon Oct 27, 2008 6:14 pm

Code:

<html>
<head>
<title>Changing the type of a variable with settype()</title>
</head>
<body>
<?php
$undecided
= 3.14;
print
gettype( $undecided );
print
" -- $undecided<br>";  

settype( $undecided, string );
print
gettype( $undecided );
print
" -- $undecided<br>";  

settype( $undecided, integer );
print
gettype( $undecided );
print
" -- $undecided<br>";  

settype( $undecided, double );
print
gettype( $undecided );
print
" -- $undecided<br>";  

settype( $undecided, boolean );
print
gettype( $undecided );
print
" -- $undecided<br>";  
?>
</body>
</html>




Post a reply
  Related Posts  to : Changing the Type of a Variable with settype()
 Testing the Type of a Variable     -  
 different between Local variable and Global variable     -  
 Changing link color     -  
 Changing the color and properties of the header tag     -  
 Changing the line height of the paragraph     -  
 Changing the color of a graph draw in java     -  
 changing the background color for site main menu.     -  
 Variable interpolation     -  
 transient variable     -  
 Unset variable     -  

Topic Tags

PHP Variables