I have an array of results that looks / similar like this:
$users = Array ( (0) => Array ( (dob) => '1977-04-25', ...... ), (1) => Array ( (dob) => '1972-09-06', ...... ), (2) => Array ( (dob) => '1985-11-20', ...... ) );
And what I need to do is find / replace the dob values with a Carbon function to return age. I do not want the actual data / dob to reach the front end so I need to alter it after the results but before the front end receives it. I know the key will be "dob" but can't figure out the correct way to loop thru the array properly and use a function to replace dob value with something like
So array_walk function with array_search but not having any luck.
Any ideas / insight would be appreciated.