 <p>You can accomplish this in 2 different ways:</p> <p>1) You could use the return value of <code>parseLink()</code> and re-assign the variable in the array:</p> <pre><code>$myText = parseLink($myArray[0]['text']); $myArray[0]['text'] = $myText; </code></pre> <p>2) You can modify your <code>parseLink()</code> function to accept the argument by reference which would cause it to be modified in place:</p> <pre><code>function parseLink(&amp;$text) { $text = ereg_replace("[[:alpha:]]+://[^&lt;&gt;[:space:]]+[[:alnum:]/]","&lt;a href=\"\\0\"&gt;\\0&lt;/a&gt;", $text); return $text; } parseLink($myArray[0]['text']); </code></pre>