I have 2 php array variables. Variables like below.
$arrIntPropertyIds = [ 1,2,3,4,5,6,7,8,9,10];
$arrIntRequestPropertyIds = [ 3, 5, 7];`
I want to check whether values of $arrIntRequestPropertyIds
are in $arrIntPropertyIds
without loop.
So I tried like below.
if( count(array_diff($arrIntPropertyIds,$arrIntRequestPropertyIds))==0 ) {
echo 'invalid property Id';
} else {
echo 'Valid property Id';
}
If all OR any of the value OR atleast 1 value is/are there in first array then it should show message 'invalid'.