This is the output I get. I want it like that, just that all rows should be sorted by first-/lastname. How can I do that?
function cmp($a, $b){
return @($a[1] < $b[1]) ? 1 : -1;
}
function print_raw($raw, $first){
foreach($raw as $val){
echo '<tr>';
$value = explode(",", $val);
//usort($value, 'cmp');
...
}
Somehow, my function doesn't work properly, so my output looks like this afterwards:
How do I have to write my function, so the order of entries inside my array stays the same while it is sorted by it's first-/lastname ?
EDIT
$fp = file($dateiname) or die("Fehler beim Öffnen der Datei!");
print_raw($fp, $first);