PHP include function

, by Prashant Gunjal

PHP include function is just like #include in c.It actually includes code from the file which is included ..
eg .

a.php file

<html>
<head>
    <title>ADDITION OF TWO Numbers</title>
</head>
<body>
<?php
    $no1=20;
    $no2=10;
    $no3;
    $no3=$no1+$no2;
    echo "<br>Addition is = $no3";
?>

Now we will include this file as :


<?php include("a.php")?>
<p>This page is includs a.php </p>
</body>
</html>

OUTPUT :


0 comments: