I have a file containing lines of information about files.
Each piece of information is separated by a "|" character.
I want to extract the information and then sort it based on some of the information (for example it contains the filename as the second piece of information)
$array = file("files.txt");
foreach ($array as $line)
{
$info = explode('|', $line);
//filename is in $info[1]
$order[] = $info[0].",".$info[1].",".$info[4].",".$info[5].",".$info[6].",".$info[8];
}
I have no idea where to start or which sort function to use. I will be needing to sort by specific array addresses
I'll need to sort $order according to $info[1] values or $info[8] values.
Any ideas????
Example file code:
d3e941fe204d0a9cc5b92782bbf882c8|spacer.gif|622397|86.132.201.123|1144010254|0||d41d8cd98f00b204e9800998ecf8427e|Audio|
f5ac269a593b652c58c1b53c160e7947|shuttle.gif|943330|86.132.201.123|1144010263|0||d41d8cd98f00b204e9800998ecf8427e|Pictures|
38dc34e2dcfc788160cc085444cd32a4|mercury.gif|367606|86.132.201.123|1144013338|0||d41d8cd98f00b204e9800998ecf8427e|Applications|