Casting a Variable : Variable Cast : Language Basics PHP Source Code


PHP Source Code » Language Basics » Variable Cast »

 

Casting a Variable



<html>
<head>
<title>Casting a variable</title>
</head>
<body>
<?php
$undecided = 3.14;
$holder = double $undecided;

print gettype$holder 
print " -- $holder<br>";   
$holder = string $undecided;
print gettype$holder );  
print " -- $holder<br>";   

$holder = integer $undecided;
print gettype$holder );  
print " -- $holder<br>";   

$holder = double $undecided;
print gettype$holder );  
print " -- $holder<br>";   

$holder = boolean $undecided;
print gettype$holder );  
print " -- $holder<br>";   
?>
</body>
</html>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» Variable Cast