string
integer

integer

Code:

<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>

<div class="topbar">
<?php
include 'navbar.php';
?>

</div>

<?php

    $foo = '1';
    
    echo gettype($foo); //outputs a string
    
    echo '<br>';
    
    settype($foo, 'integer');
    
    echo gettype($foo); //outputs an integer
    
    echo '<br>';
    echo '<br>';

    /* outputs in this format:
    
        string
        integer
    
    */
    
    //another way:
    
    $a = (int)'4';
    
    echo gettype($a);
    
?>
    

<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file("ex009.php");
?>
</div>



</body>

</html>