Re: Merging Arrays
| From: | Richard Lynch | Date: | Sat, 22 Sep 2001 04:29:46 +0000 |
| Subject: | Re: Merging Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68290@lists.php.net to get a copy of this message | ||
You left out http://php.net/sort if you want if alphabetical, but
other than
that, it looks like you're done...
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Jordan Elver <jord@theinternetone.co.uk>
Newsgroups: php.general
To: PHP General Mailing List <php-general@lists.php.net>
Sent: Friday, September 21, 2001 3:32 PM
Subject: Merging Arrays
> Hi,
> I've got to different files of words. One on each line.
> What would be the best way to combine both into one file alphabetically?
> I thought about:
>
> $file1 = file('file1.txt');
> $file2 = file('file2.txt');
> $both = array_merge($file1, $file2);
>
> print_r($both);
>
> Any advice?
>
> Cheers,
>
> Jord
> --
> Jordan Elver
> Web Developer
> The InternetOne UK Ltd