Sắp xếp trong php

Chào mọi người
Cho mình hỏi vấn đề này trong php
Mình muốn có hai câu hỏi hi vọng được giải đáp

  1. khi sắp xếp theo tên phải làm thế nào?
  2. khi sắp xếp theo ngày tháng năm sinh phải làm thế nào?
    Dữ liệu này được lấy ra từ trong database và không được dùng order by để sắp xếp

đ

Array
(
[0] => Array
    (
        [id] => 1
        [nameStudent] => Trần Thi C
        [birthDate] => 1995-01-07
        [emailStudent] => [email protected]
        [phoneNumber] => 0123456789
        [pictureProfile] => ha.png
        [name] => C
    )

[1] => Array
    (
        [id] => 2
        [nameStudent] => Nguyễn Văn B
        [birthDate] => 1996-06-04
        [emailStudent] => [email protected]
        [phoneNumber] => 0123654789
        [pictureProfile] => ha.png
        [name] => B
    )

[2] => Array
    (
        [id] => 4
        [nameStudent] => Trần Thị A
        [birthDate] => 1995-06-06
        [emailStudent] => [email protected]
        [phoneNumber] => 0123963852
        [pictureProfile] => B612_20180603_175156_011.jpg
        [name] => A
    )

[3] => Array
    (
        [id] => 5
        [nameStudent] => Nguyễn Văn D
        [birthDate] => 1995-06-19
        [emailStudent] => [email protected]
        [phoneNumber] => 0123587456
        [pictureProfile] => images1675493_google_chrome_logo_930x488.png
        [name] => D
    )
)

Google về :3
Ngắn gọn là dùng usort

6 Likes

Cám ơn bác để em thử

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?