Re: [PHP-DB] [php] file open

2003-03-24 Thread 2b4ever php

hello,

i'm using the next code:

$fp=fopen(WBSMUTA.CSV,r);
while (!(feof($fp))) {
$data_file=fgets($fp,4096);
echo br$data_filebr;
}

to open a file...

but I want to read it from line 3.. and there is a special function for, but
can't find it back :(
can someone tell me the name of this funcion?

I know I can also use a counter into the while-loop, but I know there is a
better sollution for..
thanks
The while loop is the way to solve it...don't know about an other solution...

$lineNumber = 3;

$txtnm = WBSMUTA.CSV;
$txtnm = substr($txtnm, 0, -1);
$fd = fopen ($txtnm, r);
$i = 1;
while (!feof($fd)) {
// remove first 3 lines from file
$lines = fgets($fd, 4096);
if (!($i = $lineNumber)) {
echo $lines . br;
}
$i++;
}
fclose ($fd);


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] [php] file open

2003-03-24 Thread Christian Rosentreter


 -Original Message-
 From: Snijders, Mark [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 24, 2003 1:30 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] [php] file open

 i'm using the next code:
 
 $fp=fopen(WBSMUTA.CSV,r);
 while (!(feof($fp))) {
 $data_file=fgets($fp,4096);
 echo br$data_filebr;



$data = file(WBSMUTA.CSV);
$cnt = count($data);

for ($i=2; $i $cnt; $i++)
{
echo br.$data[$i].br;
}



regards,
Christian


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php