Re: Only 5 lines (now with the right script :/ )

From: Date: Thu, 22 Mar 2001 15:22:40 +0000
Subject: Re: Only 5 lines (now with the right script :/ )
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-45128@lists.php.net to get a copy of this message
Still doesnt work, I think the problem is that the $content exist out of 1 array. So u cant limit it like in a SELECT query. The script sees the content of that array as 1 and therefor can not be splitted. THx for ure afford "Jack Sasportas" <jack@innovativeinternet.com> wrote in message news:3ABA0BF7.1C65D840@innovativeinternet.com... > 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=&quot;_blank&quot; HREF=", > > $printing[1]); > > > > $content = $printing[1]; > > $content = explode("&#183;", $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 > > > > > > -- > 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 >

« previous php.general (#45128) next »