to extract urls from a page contains any of the following word
rapidshare
megaupload
hotfile
zshare
and whatever else..............
i was trying to make a script to extract all urls and then print only which contain the words that i want
but i couldn't do it i'm a beginner php programer
i'm now tryin to programe it using a diffrent technique
using in_array function
that function will contain few strings because the page which i want to exctat urls from contain just few strings
i want to extract from a page used to protect urls
http://1tool.biz/265677
but i still couldn't achieve what i want
i wrote the following
Code: Select all
<?php
// make sure the remote file is successfully opened before doing anything else
$url="http://1tool.biz/265677";
if ($fp = fopen($url, 'r')) {
$content = '';
// keep reading until there's nothing left
while ($line = fgets($fp, 1024)) {
$content .= $line;
}
$array_content= explode(" ",$content);// all lines are stored in $array_content
// i want to write a code here to print only text match the following
if (in_array("rapidshare",$array_content))
{
echo "the full link <br />";
}
else
{
echo "Match not found<br />";
}
if (in_array("megaupload",$array_content))
{
echo "the full link <br />"; }
else
{
echo "Match not found<br />";
}
if (in_array(hotfile,$array_content))
{
echo "the full link <br />"; }
else
{
echo "Match not found<br />";
}
} else {
// an error occured when trying to open the specified url
}
?>
but i don't know how to print the full text which contain one of the following strings as an example
rapidshare
megaupload
hotfile
zshare
and whatever else..............
really i'll be very thankful if someone will help me to create such script
thanks in advance..