0
我有一個多維數組像下面,由多個列獲取獨特的數組 - PHP
,我想創建另一個陣列,顯示每個城市用戶的唯一編號
Array
(
[0] => Array
(
[id] => 1
[city] => Melbourne
[date_added] => 1435852550
[user_name] => user_1
)
[1] => Array
(
[id] => 2
[city] => Melbourne
[date_added] => 1435852550
[user_name] => user_1
)
[2] => Array
(
[id] => 3
[city] => Sydeny
[date_added] => 1435852550
[user_name] => user_2
)
[3] => Array
(
[id] => 4
[city] => Perth
[date_added] => 1435852550
[user_name] => user_3
)
[4] => Array
(
[id] => 5
[city] => Perth
[date_added] => 1435852550
[user_name] => user_4
)
)
我試圖搞定,用戶的唯一沒有每個城市像下面
Array
(
[Melbourne] => 1
[Sydeny] => 1
[Perth] => 2
)