I have two arrays, one that contains a persons first name and another one that contains a persons last name.
$firstname = array ( "John", "Tom", "Ben", "John", "David", "Julie", "David");
$lastname = array ( "Kennedy", "Hyde", "Hughes", "Harper" "Walter", "Weber", "Walter");
A persons first and last names are in both arrays with the same index ( John Kennedy, Tom Hyde, etc.) And I'm searching for a way to find duplicate values in the array $firstname
, which would be two Johns and two Davids, but then I'd need to check $lastname
with the same indexes if they are duplicate too, so the output would be David Harper, David Harper
.
The array can contain around 50+ different names and last names.
Couldn't find anything on the internet and I'm running out of ideas, any help would be greatly appreciated.