php pass by reference to function code example
Example: php pass by reference
<?php
function appendToString(&$string)
{
$string .= 'Cool Im appended';
}
$str = 'I am a start and - ';
appendToString($str);
echo $str; // outputs 'I am a start and - Cool Im appended'
?>