How to get a $haystack trimmed using a $needle?
<p>There are many functions to split a string using a needle, what is the smartest (shortest) way? </p>

<pre><code>$haystack="/this/is/the/haystack/string/to/be/trimmed/using/a/needle/string/";
$needle="to/be/";
</code></pre>

<p>result required is </p>

<blockquote>
  <p>/this/is/the/haystack/string/</p>
</blockquote>
