solve a bad Url to clean Url in php?
<p>when I spide a website ,I got a lot of bad url like these.
<code>http://example.com/../../.././././1.htm</code>
<code>http://example.com/test/../test/.././././1.htm</code>
<code>http://example.com/.//1.htm</code>
<code>http://example.com/../test/..//1.htm</code></p>

<p>all of these should be <code>http://example.com/1.htm</code>.
how to use PHP codes to do this ,thanks.</p>

<p>PS: I use <a href="http://snoopy.sourceforge.net/" rel="nofollow">http://snoopy.sourceforge.net/</a>
I get a lot of repeated link in my database , the '<code>http://example.com/../test/..//1.htm</code>' should be '<code>http://example.com/1.htm</code>' . </p>
