Hi ,
I have an object array ‘$churches’ like this :
Array
(
[0] => stdClass Object
(
[church_id] => 1
[title] => Me
)
[1] => stdClass Object
(
[church_id] => 2
[title] => Alwin
)
)
Now I need to convert these into an array in which the church_id is the index and title as element. Please let me know how can I do this. I think this may be easy but nothing is flashing through my head. I have used foreach and array_merge. But it is not seems to be working. It will be hlpful if someone can help me ASAP as it is little urgent.