I have several lines in a textfile in a format like below
number|name|date
number|name|date
Now I retrieve the data with a simple
$file = file("textfile.txt");
But I want to have the data sorted... Sorting by number is easy since I can just do a:
$file = nsort($file);
sorta thingy.
But what to do when I want it to be sorted by the name or date??? I think i'd need to first place it in a sub array by doing my regular explode... but what then? I think multisort but I really do not see how to apply it here.
or can I make a sort function read between two specific |'s ?
I'd love some help.