- strpos: documentation ( source)
- var_export: documentation ( source)
- array_flip: documentation ( source)
- array_filter: documentation ( source)
<?php
$array = array_flip(['foo_bar', 'foo_baz', 'foo_bat', 'bar_baz', 'bar_bat', 'bat_bat']);
var_export($array);
echo "\n";
var_export(array_filter($array, function($k) { return strpos($k, "_bat") !== FALSE; }, ARRAY_FILTER_USE_KEY));