the difference is by value is not working the variable outside the function and the global function is working outside the function
by value
function increment($value,$amount = 1){
$value = $value + $amount;
}
$value = 10;
increment($value);
echo $value;
reference
& is doing like a global variable is working outside the function
function increment(&$value,$amount = 1){
$value = $value + $amount;
}
$a = 10;
echo $a.'<br/>';
increment($a);
echo $a.'<br/>';