RE: PHP gurus...how are they doing this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
>
> This is how far I have come trying to imitate the
> above: (Its not working of course :-)   )
>
> <?php
> $url=fsockopen('http://www.jumac.com/');
> $html = implode('', file("$url")); //put the page
> source in a string
>
> //find the links and put them in an array
> $links = array();
> if (preg_match_all('/<a\s+.*?href=[\"\']?([^\"\'
> >]*)[\"\']?[^>]*>.*?<\/a>/i', $html, $matches))
> {
>     foreach($mathes as $match){$links[] = $match;}

If this is a copy&paste of your code you may want to change the above line
to:

      foreach($matches as $match){$links[] = $match;}
                  ^

[snip]

Graham

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux