Pop a fixed key – value pair from an associative array – PHP

I have array structure like this:

Main-Array
(
    [0] => Sub-Array
    (
        [0] => AAA
        [1] => BBB
        [2] => -
        [3] => DDD
    )

    [1] => Sub-Array
    (
        [0] => 111
        [1] => 222
        [2] => -
        [3] => 444
    )
)

As per the above mentioned example i want to pop Main-Array[0][2] & Main-Array[1][2] out of the array as both are empty..

I know to do it by executing a foreach loop and assigning a new array as per requirement.. but if there is a better way.. Then suggestions are welcomed..

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories