Merging Arrays
| From: | Jordan Elver | Date: | Fri, 21 Sep 2001 20:32:29 +0000 |
| Subject: | Merging Arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-68167@lists.php.net to get a copy of this message | ||
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