Behavior of Files Included Using include : include « Utility Function « PHP






Behavior of Files Included Using include

 
//File: test.inc
<?php

    echo "Inside the included file<BR>";

    return "Returned String";

    echo "After the return inside the include<BR>";

?>

<?php

    echo "Inside of includetest.php<BR>";

    $ret = include ('test.inc');

    echo "Done including test.inc<BR>";
    echo "Value returned was '$ret'";

?>
  
  








Related examples in the same category

1.Including Other Files
2.Including files relative to the current file
3.Using include to Load Files in PHP
4.Using include() Within a Loop
5.Using include() to Execute PHP and Assign the Return Value