我有两个数组如下:
$cmobine = array (
[0] => Array
(
[0] => KAWAT LOKET 1/2 HIJAU 10M
[1] => KAWAT LOKET 1/4 HIJAU 10M
)
[1] => Array
(
[0] => KAWAT LOKET 1/2 HIJAU 10M
[1] => KUAS ETERNA 4"
)
[2] => Array
(
[0] => KAWAT LOKET 1/2 HIJAU 10M
[1] => SIKU LUBANG
)
[3] => Array
(
[0] => SIKU LUBANG
[1] => KUAS ETERNA 4"
)
)
还有第二个阵列:
$transaction = array (
[003352] => Array
(
[0] => KAWAT LOKET 1/2 HIJAU 10M
[1] => KAWAT LOKET 1/4 HIJAU 10M
)
[003353] => Array
(
[0] => BODI LIDAH PELOR SS 2036-402 SES
[1] => KAWAT LOKET 1/2 HIJAU 10M
[2] => SIKU LUBANG
)
[003363] => Array
(
[0] => ENGSEL TIPIS BRAS 2 + SKRUP
[1] => ENGSEL TIPIS BRAS 2 1/2 + SKRUP
[2] => KUAS ETERNA 4"
[3] => LAMSKAR SN
[4] => MASKER HIDUNG
[5] => OBENG BB ANOVI
[6] => PAKU BETON 30
[7] => PAKU BETON HITAM 50
[8] => SIKU LUBANG
[9] => PAKU BETON PUTIH 5
[10] => SARINGAN GOT STAINLIS NISHIO
)
[003366] => Array
(
[0] => GRENDEL BABET GP 2" GOMEO
[1] => GRENDEL STANLIS IMPERIAL 2"
)
);
然后根据比较数组生成这样的数组:
$result = array (
[0] => Array
(
[0] => KAWAT LOKET 1/2 HIJAU 10M
[1] => KAWAT LOKET 1/4 HIJAU 10M
)
[1] => Array
(
[0] => KAWAT LOKET 1/2 HIJAU 10M
[1] => SIKU LUBANG
)
[2] => Array
(
[0] => SIKU LUBANG
[1] => KUAS ETERNA 4"
)
);
与$ombine
值进行比较的 $transaction
值,如果匹配,则结果为$combine
本身的值。
根据上面的$results
。