I have an array that looks like this:
Array ( [game.info.campaign.end_date] => 2016-07-31, [game.info.campaign.start_date] => 2016-07-11, [game.info.campaign.peak_date] => 2016-07-21, [game.info.campaign.promo] => 'pokemon_go' );
I would like to unset all of them in a few line without repeating code. Is there a way to do this in PHP?
if (array_key_exists('game.info.campaign.end_date', $result)) {
unset($result['game.info.campaign.end_date']);
}
I am doing the above right now, but there's too much repetition and some arrays have thousands of entries that start with the same prefix.