Last active
November 5, 2016 09:55
-
-
Save akamola/64283d23c0e33441a6b37c6bb0a35366 to your computer and use it in GitHub Desktop.
PHP: Find all entries of an array whose keys starts with "barfoo-"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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