Re: Sort Question (Again)
| From: | Gaylen Fraley | Date: | Sat, 22 Sep 2001 03:37:01 +0000 |
| Subject: | Re: Sort Question (Again) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68238@lists.php.net to get a copy of this message | ||
When you do $list = sort($list) you are assigning a boolean true/false to
the success/failure of the sort to $list (on the left hand side of the
equals sign). What I think you really want is:
$list = file('list_main.txt');
sort($list);
Regards,
--
Gaylen
gfraley5@earthlink.net
http://www.gaylenandmargie.com
PHP KISGB v1.2 Guestbook http://www.gaylenandmargie.com/publicscripts
"Jeff Oien" <jeff@webdesigns1.com> wrote in message
news:PGEBKOPJJHHICHGDKCCIMEELDFAA.jeff@webdesigns1.com...
> This didn't get answered before. I'm trying to sort an array but it
> won't work.
> $list = file('list_main.txt');
> $list = sort($list);
> If I print $list it gives me 1 and print $list[0] is nothing. The
list_main.txt
> looks something like this:
> ABC
> DEFG
> HIJ
> etc.
>
> Jeff Oien