时间:2021-07-01 10:21:17 帮助过:9人阅读
function myFunction($v) { $start='2013-09-23 10:48:33'; $end='2013-09-27 11:28:13'; if ($v>=$start && $v<=$end) { return true; } return false; }$t1=Array ( '0' => '南昌' ,'1' => '南昌' ,'2' => '赣州' ,'3' => '九江' ,'4' =>'赣州' ,'5' => '九江') ;$t2=Array ( '0' => '2013-09-24 17:48:33', '1' => '2013-09-23 12:48:42' ,'2' => '2013-09-21 17:48:23', '3' => '2013-09-12 08:40:03', '4' => '2013-09-23 10:28:22', '5' => '2013-09-27 11:28:13' ); $t=array_filter($t2,"myFunction"); foreach(array_keys($t) as $k) $t11[]=$t1[$k]; $t22=array_values($t); print_r($t22); print_r($t11);
function myFunction($v) { $start='2013-09-23 10:48:33'; $end='2013-09-27 11:28:13'; if ($v>=$start && $v<=$end) { return true; } return false; }$t1=Array ( '0' => '南昌' ,'1' => '南昌' ,'2' => '赣州' ,'3' => '九江' ,'4' =>'赣州' ,'5' => '九江') ;$t2=Array ( '0' => '2013-09-24 17:48:33', '1' => '2013-09-23 12:48:42' ,'2' => '2013-09-21 17:48:23', '3' => '2013-09-12 08:40:03', '4' => '2013-09-23 10:28:22', '5' => '2013-09-27 11:28:13' ); $t=array_filter($t2,"myFunction"); foreach(array_keys($t) as $k) $t11[]=$t1[$k]; $t22=array_values($t); print_r($t22); print_r($t11);