一、单一条件查询(==)
在数组中数据中,通过查询条件得出想要的数组
二、时间段查询(查个时间段内的数据)
在数组中数据中,通过查询条件得出想要的数组
查询某个时间段范围内的数据
$r = array_filter($ar, function($t) use ($catdir_so1,$catdir_so2) { return $t['catdir'] > $catdir_so1 and $t['catdir'] < $catdir_so2 ; });
三、时间段查询再加一个条件(相当案例一加上案例二)
$r = array_filter($ar, function($t) use ($catdir_so1,$catdir_so2,$catdir_so3) { return $t['cat'] == $catdir_so3 and ($t['catdir'] > $catdir_so1 and $t['catdir'] < $catdir_so2); });
四、在数组查询条件是否在数组中
$type_mold_arr=array('1','2');//1=直播
$rsoc = array_values(array_filter($rsoc2, function($t) use ($pid,$type_mold_arr) { return $t['pid'] == $pid and in_array($t['type_mold'],$type_mold_arr)==true; }));//0=只取一组数组(也只取第一组)
五、数组模糊查询
、、