fopen and preg_match
| From: | Sami Kyösti | Date: | Mon, 17 Nov 2003 14:07:42 +0000 |
| Subject: | fopen and preg_match | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-169937@lists.php.net to get a copy of this message | ||
Hi,
I have a code that should fetch the information from another webpage. The code find's the page, but I can't make it stop on </table> sign.
Where is the problem?
Here is the code
-
$fp=fopen("http://www.yle.fi/top40/index.php?page=lista_singlet20","r");
$buffer = fread ($fp, 1000000);
preg_match("|<tr class=\"listRow2\"><td class=\"listRow2\"><span class=\"listIndex\">1.+\<\/table\>|is", $buffer, $regs );
$table = $regs[0];
echo "$table";
-
Thanks for advance
Sami