PHP Programing language

How can returning References from Function
Previous Home Next
Function can also return references in PHP. the references are interesting items in PHP. For example, say that you had a variable named $value; you could get a references to that variable with the reference operator:


$ref = & value;

<title>Returning references from Functions  </title>
<h1>Returning references from Functions </h1>
$value = 4;
echo "Current value:", $value, "\n";
$ref = &return_reference ($value);
echo "New value:", $value, "\n";
function &return_reference (& $ref)
return $ref;



Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Comment / Feedback: