- in_array: documentation ( source)
<?php
$a = array(array(2));
$b = array(array(2));
if (compare_consignment($a, $b)) {
echo 'Mached';
}
else {
echo 'Not matched';
}
function compare_consignment($original, $con) {
if(count($original) != count($con)) {
return FALSE;
}
foreach ($original as $val) {
if (!in_array($val, $con)) {
return FALSE;
}
}
return TRUE;
}