RE: [PHP] Stripping the first line of a file
| From: | UGBI) | Date: | Fri, 08 Feb 2002 15:13:56 +0000 |
| Subject: | RE: [PHP] Stripping the first line of a file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83996@lists.php.net to get a copy of this message | ||
Use
$aFile=file(<FILENAME>);
//$aFile[0] contains the unwanted line
echo $aFile[1]; // displays line 2
echo $aFile[n]; // displays line n where n is an positieve interger and not
greater then the number of lines in the file
http://www.php.net/manual/en/function.file.php
HTH
Jerry
> -----Original Message-----
> From: Scott [mailto:scott@scottah.com]
> Sent: Friday, February 08, 2002 4:02 PM
> To: php-general@lists.php.net
> Subject: [PHP] Stripping the first line of a file
>
>
> Hi,
>
> I want to be able to open a file and then strip the first
> line of it off.
> Example, the first line contains the names for tables in a
> database and
> all I need is from the second line on.
>
> if I fopen a file can I strip the line or should I process it
> and then
> drop the data from the first row?
>
> Thanks,
> -Scott
>
>
> --
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
The information contained in this email is confidential and
may be legally privileged. It is intended solely for the
addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any
form of disclosure, production, distribution or any action
taken or refrained from in reliance on it, is prohibited and
may be unlawful. Please notify the sender immediately.
The content of the email is not legally binding unless
confirmed by letter bearing two authorized signatures.