Re: Everything between something becomes an array element
| From: | Andrey Hristov | Date: | Tue, 06 Nov 2001 19:52:41 +0000 |
| Subject: | Re: Everything between something becomes an array element | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73588@lists.php.net to get a copy of this message | ||
I've never used eregs but I think that . is not special char there.
Why don't you prefer pregs. preg syntaxt is quite good explained on php.net
$search=preg_match_al('|\<br\>\<br\>(.*?)\</hr\>|imx',$read,$printing,PREG_SET_ORDER);
var_dump($printing);
Regards
On Tuesday 06 November 2001 07:43 am, you wrote:
> Sure! Here you can find:
>
> http://www.geocities.com/inerte2000/teste-fetch.htm
>
> Don't mind about the <pre> or the bottom Array{}. They are there just
> because of some print_r while I try to figure out how to do it.
>
> Here's the PHP code to produce the above page:
>
> <?php
>
> $filename =
> 'http://www.stj.gov.br/stj/noticias/consulta_noticias.asp';
> $fd = fopen ($filename, 'r');
>
> $read = fread($fd, 20000);
>
> fclose($fd);
>
> $search = eregi("<br><br>(.*)<hr>", $read, $printing);
>
> $printing[1] = str_replace("detalhes_noticias",
>
> "http://www.stj.gov.br/stj/noticias/detalhes_noticias",
> $printing[1]);
>
> $var = $printing[1];
> echo '<pre>';
> print_r ($var);
> echo '</pre>';
> ?>
--
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com