Instead of unsetting values you don't need, you could select the values you need. Use array_slice()
for this purpose. The advantage of this solution over unset()
is that you don't have to specify the indexes.
$mas = array(
'Paris-Orly - Stockholm-Arlanda',
'Tuesday 25. Mar 2014 21:15 - Terminal: S',
'Flight DY4314 - LowFare',
'Stockholm-Arlanda - Copenhagen',
'Wednesday 26. Mar 2014 07:00 - Terminal: 5',
'Flight DY4151 - LowFare',
'1 Adult',
'1 Child (2-11)',
'1 Infant'
);
$output = array_slice($mas, 3);
print_r($output);
Output:
Array
(
[0] => Stockholm-Arlanda - Copenhagen
[1] => Wednesday 26. Mar 2014 07:00 - Terminal: 5
[2] => Flight DY4151 - LowFare
[3] => 1 Adult
[4] => 1 Child (2-11)
[5] => 1 Infant
)