How to search and replace a string in PHP
<p>I need a PHP function that accepts a string, searches for a certain sub string and then replaces that sub string with something else.</p>

<p>Example:</p>

<ul>
<li>Input:  www.google.com/%hello%</li>
<li>Search for:  %hello%</li>
<li>Replace with:  hi</li>
<li>Output:  www.google.com/hi</li>
</ul>

<p>If anyone has any suggestions I'd really appreciate it</p>

<p>Oh yeh, the string is within an element of an array example array[this_string],I need to change the contents of the string within the element of the array.</p>

<p>Thanks!</p>
