select tag in php and get href
<p>i want <strong>get all link in page by class "page1" in php</strong>.
the same code in jquery </p>

<pre><code>$("a#page1").echo(function()
{
});
</code></pre>

<p>can do that in php?</p>

<pre><code>$pattern = '`.*?((http|ftp)://[\w#$&amp;+,\/:;=?@%.-]+)[^\w#$&amp;+,\/:;=?@%.-]*?`i';
preg_match_all($pattern,$page_g,$matches);
</code></pre>

<p>this code get all href in the $page_g but its not work for class="page1".
<strong>i want only all href in $page_g by class="page1"</strong>
can help me for optimize reqular ex or other way?
for example</p>

<pre><code>$page_g="&lt;a href="/?s=cache:16001429:office+s01e02" title="" class="big"&gt;the &lt;strong&gt;office&lt;/strong&gt; us s01 05 xvid mu&lt;/a&gt; &lt;a href="asd.com" class="a"&gt;asd&lt;/a&gt;";
</code></pre>

<p>i want return only /?s=cache:16001429:office+s01e02
tnx</p>
