I want to remove a specific array key from all the inner arrays. I know there is a function called unset()
which uses index or object name to slice it out. But I am not able to implement in my case in the below code.
[answers] => Array
(
[0] => Array
(
[title] => First Answer 1
[image] =>
[isCorrect] => 1
)
[1] => Array
(
[title] => Second Answer
[image] =>
[isCorrect] => 0
)
[2] => Array
(
[title] => Third Answer
[image] =>
[isCorrect] => 0
)
[3] => Array
(
[title] => Fourth Answer
[image] =>
[isCorrect] => 0
)
)
How can I remove [image] from each of the arrays in [answers]?