Making arguments be passed by reference:
Making arguments be passed by reference:
================================
By default,if the function arguments are passed by value .In which value is changed within that scope not outside the scope. To change value out of the function we have to pass by reference
If an argument passed to function as a reference. We have to prepend the (&) symbol to argument name
in the function definition:
function pass_refer(&$value)
{
$value = 10;
}
$value = ‘20′;
pass_refer($value);
echo $value;
output
=======
10
