Using include() to Execute PHP and Assign the Return Value
<html>
<head>
<title>Using include() to execute PHP and assign the return value</title>
</head>
<body>
<?php
$addResult = include("myIncludeFileWithReturnValue.php");
print "The include file returned $addResult";
?>
</body>
</html>
<!-- myIncludeFileWithReturnValue.php
<?php
$retval = ( 4 + 4 );
return $retval;
?>
-->
Related examples in the same category