how to replace the character?
<pre><code>   $a="dir=desc&amp;order=position&amp;"
</code></pre>

<p>i want to replace <code>=</code> to <code>-</code>,  <code>&amp;</code> to <code>-</code>.</p>

<p>i using the following code:</p>

<pre><code>           $a = str_replace('&amp;','-',$a);
            $a = str_replace('=','-',$a);
</code></pre>

<p>it now turns to <code>dir-desc-order-position-</code>. but i want to get <code>dir-desc-order-position</code>. namely, the last character replace with null <code>""</code>.</p>
