一週有7天:Sunday、Monday、Thesday、Wednesday、Thursday、Friday、Saturday、
foreach 用法:Sunday, Monday, Thesday, Wednesday, Thursday, Friday, Saturday,

Array ( [0] => Sunday [1] => Monday [2] => Thesday [3] => Wednesday [4] => Thursday [5] => Friday [6] => Saturday )

mealArray=7, 總和=49
sort排序結果:
Array ( [0] => Array ( [0] => Friday [1] => 星期五 [2] => 芭樂 [3] => 7 ) [1] => Array ( [0] => Monday [1] => 星期一 [2] => 蘋果 [3] => 3 ) [2] => Array ( [0] => Saturday [1] => 星期六 [2] => 萫茄 [3] => 10 ) [3] => Array ( [0] => Sunday [1] => 星期日 [2] => 香蕉 [3] => 7 ) [4] => Array ( [0] => Thesday [1] => 星期二 [2] => 鳯梨 [3] => 2 ) [5] => Array ( [0] => Thursday [1] => 星期四 [2] => 梨 [3] => 15 ) [6] => Array ( [0] => Wednesday [1] => 星期三 [2] => 檸檬 [3] => 5 ) )
usort 排序結果:
用表格表示
0Thesday星期二鳯梨2
1Monday星期一蘋果3
2Wednesday星期三檸檬5
3Sunday星期日香蕉7
4Friday星期五芭樂7
5Saturday星期六萫茄10
6Thursday星期四15

反向排序:Array
(
    [0] => Array
        (
            [Eng] => Thursday
            [Cht] => 星期四
            [Fruit] => 梨
            [price] => 15
        )

    [1] => Array
        (
            [Eng] => Saturday
            [Cht] => 星期六
            [Fruit] => 萫茄
            [price] => 10
        )

    [2] => Array
        (
            [Eng] => Sunday
            [Cht] => 香蕉
            [Fruit] => 星期日
            [price] => 7
        )

    [3] => Array
        (
            [Eng] => Friday
            [Cht] => 星期五
            [Fruit] => 芭樂
            [price] => 7
        )

    [4] => Array
        (
            [Eng] => Wednesday
            [Cht] => 星期三
            [Fruit] => 檸檬
            [price] => 5
        )

    [5] => Array
        (
            [Eng] => Monday
            [Cht] => 星期一
            [Fruit] => 蘋果
            [price] => 3
        )

    [6] => Array
        (
            [Eng] => Thesday
            [Cht] => 星期二
            [Fruit] => 鳯梨
            [price] => 2
        )

)
1