Source Code:
(back to article)
<?php $arr1 = [1, 2, 3, 4, 5]; $arr2 = [3, 5, 1]; if (count(array_intersect($arr2, $arr1)) == count($arr2)) { echo "All values from arr2 are present in arr1."; } else { echo "Not all values from arr2 are present in arr1."; }
Result:
Report an issue