[PHP] Only 5 lines (now with the right script :/ )

2001-03-22 Thread Dennis Haller

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("DIVBnieuws.hoofd/BULLI(.*)/UL/DIVDIVBnieuws.overig
/BULLI", $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;_blankquot; 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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

2001-03-22 Thread Jack Sasportas

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("DIVBnieuws.hoofd/BULLI(.*)/UL/DIVDIVBnieuws.overig
 /BULLI", $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;_blankquot; 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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

2001-03-22 Thread Dennis Haller

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" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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("DIVBnieuws.hoofd/BULLI(.*)/UL/DIVDIVBnieuws.overig
  /BULLI", $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;_blankquot;
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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]





 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]