PHP Multisort与strtime

时间:2018-10-12 00:27:30

标签: php sorting

你好,我有问题要与strtotime行 publishedAt 排序,但我遇到错误

  

警告:array_multisort():参数3应该是第6行D:\ xampp \ htdocs \ test \ page.php中的数组或排序标志

$sql = "SELECT * FROM users";
$result = $conn->query($sql);
foreach ($result as $key => $part) {
       $sort[$key] = strtotime($part['publishedAt']);
    }
    array_multisort($sort, SORT_DESC, $videoList);

    for( $i= 0 ; $i <= count($videoList)-1 ; $i++ )
    {
        if(isset($videoList[$i]["videoId"])) {
            echo $videoList[$i]["videoId"];
        }
    }

0 个答案:

没有答案