Is possible to remove all empty elements from a array except the first element? Looking at this example:
Original
Array (
[0] => val1
[1] => val2
[2] => val3
[3] =>
[4] => val4
[5] => val5
[6] => val6
[7] =>
[8] => val7
[9] => val8
[10] => val9
)
Desired Result
Array (
[0] => val1
[1] => val2
[2] => val3
[3] =>
[4] => val4
[5] => val5
[6] => val6
[7] => val7
[8] => val8
[9] => val9
)
Is this possible? Which is the best way to achieve this?
Thanks in advance for your help.
foreachloop.