I have tried to compare a value to another value in an array. However, the message only displays exits in array 2even when I have two different values (one is 10, the other values from the array are 4 and 6)
if (in_array($post,$orderP)==0){
echo ' exists in array2';
}else{
echo 'does not exists in array2';
}
echo $post; //gives a value of 10
echo var_dump ($orderP);
gives a value of
array(2) { [0]=> array(2) { ["post_ID"]=> string(1) "4"
[0]=> string(1) "4"
}
[1]=> array(2) { ["post_ID"]=> string(1) "6"
[0]=> string(1) "6"
}
}