我将CSV数据加载到多维数组中.这样,每个"行"都是一个记录,每个"列"包含相同类型的数据.我正在使用下面的函数加载我的CSV文件.
function f_parse_csv($file, $longest, $delimiter)
{
$mdarray = array();
$file = fopen($file, "r");
while ($line = fgetcsv($file, $longest, $delimiter))
{
array_push($mdarray, $line);
}
fclose($file);
return $mdarray;
}
Run Code Online (Sandbox Code Playgroud)
我需要能够指定要排序的列,以便重新排列行.其中一列包含格式为的日期信息,Y-m-d H:i:s
我希望能够以最近的日期为第一行进行排序.