Jump to content

Array_multisort


-Karl-

Recommended Posts

Any examples on how to apply it when trying to sort a CSV file.

 

<?php
$row = 1;
if (($handle = fopen("thefile.csv", "r")) !== FALSE) {

    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($data);
        $row++;
            echo '<tr>';
            echo '<td>' .$data[0]. '</td>';
            echo '<td>' .$data[2]. '</td>';
            echo '<td>' .$change. '</td>';
            echo '<td>' .$data[3]. '</td>';
            echo '<td><img src="./images/' .$which. '.png"></td>'; 
            echo '<td><img src="./images/' .$base. '.png"></td>'; 
            echo '<td><img src="./images/' .$data[4]. '.png"></td>';  
            echo '</tr>'; 
    }
    fclose($handle);

}
?>

 

I have that so far, however, I have the headings for each of the <td>'s that I want to link, to sort the data, by whatever has been clicked.

 

Link to comment
https://forums.phpfreaks.com/topic/204998-array_multisort/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.