Re: Only 5 lines (now with the right script :/ )
| From: | Jack Sasportas | Date: | Thu, 22 Mar 2001 14:28:07 +0000 |
| Subject: | Re: Only 5 lines (now with the right script :/ ) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45120@lists.php.net to get a copy of this message | ||
I'm guessing you are getting an extra blank....
If you get a result back in $headlines = sizeof($content) of 5, then you have 5
lines, but in your script you have the value of $i as ZERO ($i = 0; $i <
$headlines; $i++)
meaning 0,1,2,3,4,5 which is 6 lines, simply set your $i=1 and it should be
correct.
Let me know.
I did execute your script off of my server and resulted in only 1 line printing
the value of "1" nothing else....
Jack
Dennis Haller wrote:
> The question I asked before was for this script:
>
> <?
> $open = fopen("http://nu.nl/deeplink_html",
> "r");
>
> $read = fread($open, 1000);
>
> fclose($open);
>
> $search =
>
> eregi("<DIV><B>nieuws.hoofd</B><UL><LI>(.*)</UL></DIV><DIV><B>nieuws.overig<
> /B><UL><LI>", $read, $printing);
>
> $printing[1] = str_replace("<LI>", "", $printing[1]);
> $printing[1] = str_replace("</LI>", "<br>", $printing[1]);
> $printing[1] = str_replace("<A HREF=", "<A
> target="_blank" HREF=",
> $printing[1]);
>
> $content = $printing[1];
> $content = explode("·", $content);
>
> $headlines = sizeof($content);
>
> for ($i = 0; $i < $headlines; $i++) {
>
> print "$content[$i] $headlines[$i]";
>
> }
> ?>
>
> So is it posible to get only 5 lines out of this script?
>
> Thx again
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net