Multiple Operations in PHP
array_intersect
array_diff
array_intersect_assoc
array_intersect_key
array_diff_assoc
array_diff_key
Given arrays:
<?php
$arr1 = [1, 2, 3, 4, 5];
$arr2 = [3, 4, 5, 6, 7];
?>
Write to a new array the elements that are present in both arrays.
Given arrays:
<?php
$arr1 = [1, 2, 3, 4, 5];
$arr2 = [3, 4, 5, 6, 7];
?>
Write to a new array the elements that are not present in both arrays simultaneously.