javascript code to php?
<p>How do I write the following javacript code in php:</p>

<pre><code>var ShareImageIdVar = location.href.match(/\d+/);
</code></pre>

<p>there is a number in the url that I want to store it in the variable <code>ShareImageIdVar</code>.</p>

<p>an example of a possible url:</p>

<pre><code>http://www.mysite.com/5.php
http://www.mysite.com/41.php
http://www.mysite.com/547.php
http://www.mysite.com/2145.php
</code></pre>
