Problem Statement
Explain pass by reference in PHP functions.
Explanation
When a variable is passed by reference, the function gets the original variable, not a copy. Changes inside the function affect the original. Use an ampersand before the parameter name.
Code Solution
SolutionRead Only
function addOne(&$num){ $num++; } $x=5; addOne($x);