Re: Exploding a file using a new line as the separator
| From: | Josh G | Date: | Wed, 13 Dec 2000 00:27:30 +0000 |
| Subject: | Re: Exploding a file using a new line as the separator | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29991@lists.php.net to get a copy of this message | ||
pppht.
If it's a file, simply do $array_of_lines = file("filename.txt");
Gfunk
----- Original Message -----
From: "Joe Stump" <joe@earth.care2.com>
To: "Brandon Orther" <brandon@webintellects.com>
Cc: <php-general@lists.php.net>
Sent: Wednesday, December 13, 2000 11:24 AM
Subject: Re: [PHP] Exploding a file using a new line as the separator
> Sure!
>
> $fp = fopen('/some/file.txt','r');
> $contents = fread($fp,filesize('/some/file.txt'));
> $array_of_lines = explode("\n",$contents);
>
> --Joe
>
> On Tue, Dec 12, 2000 at 04:23:54PM -0800, Brandon Orther wrote:
> > Hello,
> >
> > Is there a way to explode or split a variable every time there is a new
> > line?
> >
> > thanx for any help you give.
> >
> > Thank you,
> >
> > --------------
> > Brandon Orther
> >
> > --
> > 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
>
> ---
> Joe Stump
> PHP Programmer
> www.Care2.com
>
>
> --
> 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
>