Function Six
6This is inside Function six() : a = 16
16This is inside Function six() : a = 16
16
<?php
include('includes/header.php');
// code
error_reporting(E_ALL); // set error reporting to all
echo('<h1>Function Six</h1>');
//============= functions ===============
// function six ---------
// a function that receives a referenced variable, adds 10 to it, and echo's that value
// NOTE: the value here is not returned, but rather the value of the referenced variable
// is changed
function six(&$b)
{
$b = $b + 10;
echo("<p>This is inside Function six() : a = $b</p>");
// note there is NO return
}
$a = 6;
echo($a);
// NOTE the & reference and NO return -- yet the variable is changed
six($a); // call to function six
echo($a);
include('includes/footer.php');
?>