1. array_column
依照指定欄位名稱(key)
取出陣列
1 | $records =[ |
2. array_keys
回傳指定陣列的key
1 | $records =[ |
3. array_values
1 | $records =[ |
4. array_map
1 | $newRecords = array_map(function($record){ |
5. array_filter
1 | $newRecords = array_filter( |
6. array_push
1 | $num = [1,2,3,4]; |
7. array_pop
1 | $num = [1,2,3,4]; |
8. array_merge
1 | $person = ['id' => 5, 'name' => 'kite']; |
9. asort
value排序
1 | $arr = ['d' =>'bubu' ,'c' => 'snow','b'=> 'kite' , 'a' =>'apple']; |
10. ksort
key排序
1 | $arr = ['d' =>'bubu' ,'c' => 'snow','b'=> 'kite' , 'a' =>'apple']; |
11. array_search
1 | $people = ['john','tim','tim','kite']; |
12. array_unique
1 | $people = ['john','tim','tim','kite']; |
13. array_sum
1 | $nums = [1,2,3,4,5,6,7,8,9,10]; |
14. count
1 | $nums = [1,2,3,4,5,6,7,8,9,10]; |