Substring replace php?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7721314/php-string-replace">PHP string replace?</a>  </p>
</blockquote>



<p>I am trying to replace a part of a string with nothing, essentially deleting it. Here is my code so far.</p>

<pre><code>        $string = 'sidePanel[]=3&amp;sidePanel[]=4&amp;sidePanel[]=1&amp;sidePanel[]=2';

    $position = strpos('&amp;' . $string, '&amp;sidePanel[]=3') + strlen('sidePanel[]=3');
    $sidePanel = substr_replace($string, '', $position, 0);

    echo $sidePanel;
</code></pre>

<p>The string can appear in any order each seperated by &amp; symbols, this though seems not to work.</p>
