By default arguments are passed by value(so that it will changed inside function only not outside the function).So we are going the value then send value by reference,prepend by (&) to the argument name in the function definition.
Syntax
function fun_name(&$varname)
Example
Output
Syntax
function fun_name(&$varname)
Example
<?php function my(&$num) { $num='welcome'; } $str="welcome"; my($str); echo $str; ?> |
Output


