as

Write a PHP script to use Functions (Call by reference).

Write a PHP script to use Functions (Call by reference). 




Code:-
<?php

    function byref(&$num1,&$num2)
    {
         $num1++;
         $num2++;
    }
    $n1=10;
    $n2=20;
    echo "<br>Original Value Of n1= $n1 & n2= $n2<b>";
    byref(&$n1,&$n2);
    echo "<br>By Ref Value Of n1= $n1 & n2= $n2<br>";
?>
Output :-
Original Value Of n1= 10 & n2= 20
By Ref Value Of n1= 11 & n2= 21