标签:php 数组
<?php
$items = [
["ip"=>"10.1.1.3", "count"=>123],
["ip"=>"210.33.182.1", "count"=>34],
["ip"=>"82.12.193.2", "count"=>2],
["ip"=>"10.2.124.1", "count"=>20],
["ip"=>"10.1.1.3", "count"=>29],
["ip"=>"101unknow", "count"=>345],
["ip"=>"10.2.124.1", "count"=>20],
["ip"=>"10.80.19.92", "count"=>20],
];
echo "<pre>";
array_walk($items,function(&$value){
if(!preg_grep(‘/^(10|196|170)\\./‘,$value)){
$value = ‘‘;
}
});
$arrFilter = (array_filter($items));
$arrMap = array_map(function($val){
print_r($val);
},$arrFilter);
本文出自 “站在火星看地球” 博客,请务必保留此出处http://jlisr.blog.51cto.com/6117729/1679146
标签:php 数组
原文地址:http://jlisr.blog.51cto.com/6117729/1679146