Hello, I've been trying out a bunch of array functions to achieve this but I can't figure it out. I have a larger array i.e.:
['places']=>array(
[0]=>array(
['city']=>'Montreal',
['province']=>'Quebec'
),
[1]=>array(
['city']=>'Toronto',
['province']=>'Ontario'
),
[2]=>array(
['city']=>'Vancouver',
['province']=>'British Columbia'
),
[3]=>array(
['city']=>'Ottawa',
['province']=>'Ontario'
)
)
From this array, I would like to create a smaller array based on, say, the 'province' key:
array('Quebec','Ontario','British Columbia','Ontario');
The tricky part, which isn't illustrated here, is that the larger array can contain the specified key at any level, so the function I'm looking for would obviously have to be recursive. I'm pretty sure there's a simple function I overlooked, right?
Much appreciated!