gorilla1
12-15-2002, 12:26 AM
I am trying to sort the records in a file, then index into the array, with the following code:
$data = file('xxx.txt');
$data = asort($data);
foreach($data as $key=>$element) {
This code fails with this message:
Invalid argument supplied for foreach()
That makes it sound like the sort left me without an array??
Note that if I leave out the line with the sort in it, the code works fine.
G
$data = file('xxx.txt');
$data = asort($data);
foreach($data as $key=>$element) {
This code fails with this message:
Invalid argument supplied for foreach()
That makes it sound like the sort left me without an array??
Note that if I leave out the line with the sort in it, the code works fine.
G