yes but you might want to use a for() loop instead since you know what you
want.

$arrayoflines   = file(“$file.txt”);
$arraysize              = sizeof($arrayoflines);
$limit          = $arraysize - 2;

for (i=0; i<$arraysize; i++) {
        if ( (i>12) && (i<$limit) ) {
        $output .=      $arrayoflines[i];
        }
}

you’ll have to debug, but it should work.

DanO


-----Original Message-----
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 8:43 AM
To: Dan Olsen; [EMAIL PROTECTED]
Subject: Re: [PHP] Making a variable -Trim output


Thanks again,
Is there a way I can tell it to print all but the first 13 lines and the
last two lines of the text file?

-Clayton


----- Original Message -----
From: "Dan Olsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 26, 2001 11:39 AM
Subject: RE: [PHP] Making a variable


>
> you can concatentate the variable inside the foreach loop.
>
> foreach (file("$file.txt") as $line) {
> $data .=  ("" . trim(str_replace("'", "''", $line)) . "\n");
> }
>
>
>


-- 
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]

Reply via email to