Assigning a Variable by Reference : Reference « Language Basics « PHP






Assigning a Variable by Reference

<html>
<head>
<title>Assigning a variable by reference</title>
</head>
<body>
<?php
$aVariable = 42;
$anotherVariable = &$aVariable;

$aVariable= 325;
print $anotherVariable;
?>
 </body>
</html>

           
       








Related examples in the same category

1.Assign reference to a variable
2.unset reference variables
3.Variable References Demo