Use of Referencing in php
There are advantages of using references, for example you don’t have to return anything from the function, nor do you have to look to define them as globally accessible.
EXAMPLE:
function lowercase(&$string){
$string = strtolower($string);
}
$name = 'SAJU';
lowercase($name);
echo $name; // returns saju
Leave a Reply
Want to join the discussion?Feel free to contribute!