matching url to another url
<p>I am faced with rather unusual situation</p>

<p>I will have url in any of the 3 formats:</p>

<ol>
<li><a href="http://example.com/?p=12" rel="nofollow">http://example.com/?p=12</a></li>
<li><a href="http://example.com/a-b/" rel="nofollow">http://example.com/a-b/</a></li>
<li><a href="http://example.com/a.html" rel="nofollow">http://example.com/a.html</a></li>
</ol>

<p>Now, I need to match with a url like</p>

<ol>
<li><a href="http://example.com/?p=12&amp;t=1" rel="nofollow">http://example.com/?p=12&amp;t=1</a></li>
<li><a href="http://example.com/a-b/?t=1" rel="nofollow">http://example.com/a-b/?t=1</a></li>
<li><a href="http://example.com/a.html?t=1" rel="nofollow">http://example.com/a.html?t=1</a></li>
</ol>

<p>How can I achieve this? Please help</p>

<p>I know I can use like:</p>

<pre><code>stristr('http://example.com/?p=12','http://example.com/?p=12&amp;t=1')
</code></pre>

<p>but this will also match when</p>

<pre><code>http://example.com/?p=123 (as it matches p=12)
</code></pre>

<p>Help guys, please.</p>
