extract a substring from a string in php
<p>I have a string </p>

<pre><code>$url = "http://www.example.com/index.php?1234567"
</code></pre>

<p>I only want the substring "http://www.example.com", that is extract the substring upto the third occurrence of the forward-slash character.</p>

<p>thanks in advance</p>
