PHP Programing language

How Can Passing by Reference
Previous Home Next
When you pass data to a function, what's really passed is a copy of that data. So, for example, if you pass a variable, a copy is made of that variable, and that copy is actually passed to the function.

For example:

<title>Passing Reference to Functions </title>
<h1>Passing Reference to Functions </h1>
$value = 4;
echo "Before the call, \$value holds $value <br>";
squarer ($value);
echo "After the call, \$value holds $value <br>";
function squarer (&$number)
$number *= $number;



Previous Home Next