Is there a way to join two arrays based upon a same value in a key? As an example in MySQL you can left join two tables when two fields have the same value in it.
The first array called 'phoneArr' is one with a person_id and a phone number The second array called 'clientDate' is one with a person_id and a appointment date.
Here are the arrays:
$phoneArr = array();
$phoneArr[0]['person_id'] = "123456";
$phoneArr[0]['phone'] = "555-2222";
$phoneArr[1]['person_id'] = "7654321";
$phoneArr[1]['phone'] = "555-1111";
$clientDate = array();
$clientDate[0]['person_id'] = "123456";
$clientDate[0]['date_time'] = "01-07-13 13:00";
$clientDate[1]['person_id'] = "7654321";
$clientDate[1]['date_time'] = "01-07-13 10:30";
Now if the person id in clientDate will always exist in the phoneArr, but not the other wat around. The persons in the phoneArr do not always exist in the clientDate.
What I want is to get a match of these arrays where I will be left with a new array with the info of both arrays, but only of there is a match on the 'person_id'.
Is this doable without MySQL?