日期:2014-05-17 浏览次数:20477 次
$data1 = array(
[0] => array(
times => '2012-10-10',
type =>0,
num =>100
),
[1] => array(
times => '2012-10-11',
type =>0,
num =>103
),
....
)
$data2 = array(
[0] => array(
times => '2012-10-10',
type =>1,
num =>400
),
[1] => array(
times => '2012-10-11',
type =>1,
num =>403
),
....
)
$data = array(
[0] => array(
times => '2012-10-10',
type =>0,
num =>100
type =>1,
num =>400
),
[1] => array(
times => '2012-10-11',
type =>0,
num =>103
type =>1,
num =>403
),
....
)
$date=array(array("time"=>"2012-11-10","type0"=>0,"num0"=>100),array("time"=>"2012-11-11","type0"=>0,"num0"=>103));
$date1=array(array("time"=>"2012-11-10","type1"=>1,"num1"=>105),array("time"=>"2012-11-11","type1"=>1,"num1"=>120));
$cnt=count($date);
for($i=0;$i<$cnt;$i++){
$date2[$i]=array_merge($date[$i],$date1[$i]);
}
echo "<pre>";
print_r($date);
print_r($date1);
print_r($date2);
echo "</pre>";
//结果如下
Array
(
[0] => Array
(
[time] => 2012-11-10
[type0] => 0
[num0] =>&nbs