I am new to pattern match. here is my code : Shows the result : I don't want to see the words from " (i.e " target="_blank etc) Any help!
<? $file = file_get_contents('http://www.rapidsurfing.net/download.html'); preg_match_all('/\"(.*)rapidshare.com(.*)\"\s/',$file,$a); $count = count($a[0]); echo "<b>Number of Urls</b> = " .$count."<p>"; for ($row = 0; $row < $count ; $row++) { echo str_replace('"','',$a[0]["$row"])."<br>"; } ?>
Hi, This works: <? $file = file_get_contents('http://www.rapidsurfing.net/download.html'); preg_match_all('/(rapidshare.com.*?)"/',$file,$a); $count = count($a[1]); echo "<b>Number of Urls</b> = " .$count."<p>"; for ($row = 0; $row < $count ; $row++) { echo $a[1]["$row"]."<br>"; } ?> PHP: Jay
Thankz a lot! Can I extract the names ? eg : rapidshare.com/files/115271201/MadWorld_Trailer.zip.html I want MadWorld_Trailer.zip How can it be done ?
<? $a='rapidshare.com/files/115271201/MadWorld_Trailer.zip.html'; $b=explode('/',$a); echo $b[count($b)]; ?>