Source Code:
(back to article)
<?php $arr1 = ["a", "b", "c"]; $arr2 = ["a", "b"]; if (empty(array_diff($arr2, $arr1))) { echo "arr1 contains all values from arr2"; } else { echo "arr1 does not contain all values from arr2"; }
Result:
Report an issue