- array_intersect: documentation ( source)
- var_export: documentation ( source)
<?php
$array1 = ['apple', 'orange', 'orange', 'apricot', 'melon', 'watermelon'];
$array2 = ['apple', 'orange', 'orange'];
var_export(
array_intersect($array2, $array1)
);