Subject: PHP

Find Common Elements Between Two Arrays using foreach

Create two arrays, $arr1 = [1, 2, 3, 4] and $arr2 = [3, 4, 5, 6]

Use a foreach loop to find and print the common elements between the two arrays.

Select file or drag and drop

PNG, JPG, SVG

Preview