时间:2021-07-01 10:21:17 帮助过:20人阅读
$a = array (
0 =>
array (
'packageno' => 'S2Y140805025',
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4212',
),
1 =>
array (
'packageno' => 'S2Y140805025',
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4214',
),
2 =>
array (
'packageno' => 'SYS140804073',
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4212',
),
3 =>
array (
'packageno' => 'SYS140804073',
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4213',
),
4 =>
array (
'packageno' => 'SYS140731064',
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4154',
),
5 =>
array (
'packageno' => 'SYS140731064',
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4210',
),
6 =>
array (
'packageno' => 'SYS140801090',
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4200',
),
7 =>
array (
'packageno' => 'SYS140801090',
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4210',
),
);
$b = array (
0 =>
array (
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4211',
),
1 =>
array (
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4212',
),
2 =>
array (
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4213',
),
3 =>
array (
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4214',
),
4 =>
array (
'type' => 'ECS0-235',
'cust_no' => '12654172',
'lotno' => '4216',
),
5 =>
array (
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4154',
),
6 =>
array (
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4200',
),
7 =>
array (
'type' => 'ECS1-713',
'cust_no' => '12657727',
'lotno' => '4210',
),
);
function foo($a, $b) {
foreach($a as $v) {
$c[] = array_search($v, $b);
}
for($i=1; $iif(abs($c[$i] - $c[$i-1]) != 1) {
return '不连续';
}
}
return '连续';