>This goes back to your regular expression thing, right?
>
>What is the pattern you're using now, and what's the PHP code?

OK, the regex is working fine, the complete listing of code is below.  The
idea is that I can take a list of URLs and the "<a href="*">...</a>" from a
page and then just list them.

I'm going to be using it to track a "Add Links" page and get an email update
of them when I want to see it...

code:

<?

//Set the url to be retrieved
$theURL="http://www.interactwiththe.net/retrieve/retrieve.html";;

if(!($fp = fopen($theURL,"r")))
{
        echo "Could not open the URL"; //Make sure it can be opened
        exit;
}

$contents = fread($fp, 500000); //Read the contents into a variable

// find the pattern <a href="...">...</a>
$pattern= '<a href="[^"]*[^"]*">*[A-Z0-9 ]+</a>';

if(eregi($pattern, $contents, $quote)) // Scan the contents and look for the
expresion,
{                                                  // Put all instances into
an array
$number=count($quote);
for($i=0; $i < count($quote); $i++)
        {
        $body .= $quote[$i]."\n"; // print each link on a new line in the
plain text $body
        }
}
else
{
        echo "no links available";
}
fclose($fp); // Close the file
mail("[EMAIL PROTECTED]","List of Links",$body); //Email the list of
links to me
?>

:end code

Look forward to your analysis!

Cheers,

MAtt

____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to