How to assign global variable value in a function in php?
<p>i need to assign a global variable value by passing it in a function, something like static variable i guess. Here is my code</p>

<pre><code>&lt;?php

//this is old value
$var = "Old Value";

//need to change the value of global variable
assignNewValue($var);
echo $var;

function assignNewValue($data) {
    $data = "New value";
}
?&gt;
</code></pre>

<p>After the execution the value of var need to be New Value. Thanks in advance.</p>