[Solved] PHP Strip specific keys in array


Assuming that you want to so something(remove Arrival) on each of the values, you can use this:

<?php

$results = array (
  'date' => '22. jan.',
  'flightNumber' => 'EZY6747',
  'airline' => 'easyJet',
  'from' => 'Belfast International',
  'plannedArrival' => '18:35',
  'realArrival' => 'Estimated Arrival 18:32'
);

$result2 = array_map(function($s)
{
  return str_replace('Arrival ', '', $s);

}, $results);

print_r($result2);

solved PHP Strip specific keys in array