Wildcard match on array keys
Curious if anyone has a cool snippet or idea for how to accomplish the following:
Obviously it would be nice to just replace * with .+, but special characters could cause a problem, right? I also couldn't come up with a graceful solution using explode.
* Select all of the keys matching a given key. Asterisks (*)
* should be treated as wildcards and would match any string
* similar to a regex expression: 'test_*_asdf' => 'test_.+_asdf'
* @param string $wild_key
* @param array $array
* @return array