Apr 20, 2008

PHP Variable Reference

PHP Variable Reference

Variables in PHP may be passed by reference. If a variable is passed by reference, the function it is being passed to can modify the variable. A variable reference is not the same as a pointer, they are symbol table aliases. When a variable is passed by reference, the reference sign,"&" is only a part of the function definition. A variable may be passed to a function as follows:

double ($value1);

The function:

function double (&$invalue)
{
   $invalue += $invalue;
}

No comments:

Post a Comment

Popular Posts