PHP Practice 2
PHP Practice 2
<html>
<head>
</head>
<body>
<?php
echo "<br>";
$testing = 5;
echo "<br>";
$testing = "five";
echo "<br>";
$testing = 5.0;
echo "<br>";
$testing = true;
echo "<br>";
?>
</body>
</html>
//Program 16: To change the type of variable
<html>
<head>
</head>
<body>
<?php
$undecided = 3.14;
settype($undecided, 'string');
settype($undecided, 'integer');
settype($undecided, 'double');
settype($undecided, 'boolean');
?>
</body>
</html>
//Program 17: Casting
<html>
<head>
<title>Casting a variable</title>
</head>
<body>
<?php
$undecided = 3.14;
echo "<hr>";
?>
</body>
</html>