Skip to content

Instantly share code, notes, and snippets.



Last active Nov 5, 2016
What would you like to do?
PHP: Find all entries of an array whose keys starts with "barfoo-"
foreach ( $foobar as $key => $value ) {
if ( preg_match('/^barfoo-/', $key) ) {
// Array entries of $foobar whose keys starts with barfoo-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.