当前位置:Gxlcms > PHP教程 > php数据有关问题,

php数据有关问题,

时间:2021-07-01 10:21:17 帮助过:15人阅读

php数据问题,请教高手!
有这样一个数组:
Array
(
[0] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 39.9289
[longitude] => 116.3883
)

[1] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 42
[longitude] => 43.5
)

[2] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 38.9122
[longitude] => 121.6022
)

[3] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 40.5525
[longitude] => -74.2915
)

[4] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 40.5525
[longitude] => -74.2915
)

[5] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 38.9122
[longitude] => 121.6022
)

[6] => Array
(
[time] => 1382060855000
[day] => 2013-10-18
[latitude] => 38.9122
[longitude] => 121.6022
)
)

里面的经纬度有重复的数据,想过滤掉重复数据,并且得到每一个相同经纬度的数量。最后得到的数组如下:


这个要怎么实现呢? php 数组

分享到:


------解决方案--------------------
$ar = array (
0 =>
array (
'time' => '1382060855000',
'day' => '2013-10-18',
'latitude' => '39.9289',
'longitude' => '116.3883',
),
1 =>
array (
'time' => '1382060855000',
'day' => '2013-10-18',
'latitude' => '42',
'longitude' => '43.5',
),
2 =>
array (
'time' => '1382060855000',

人气教程排行