Skip to content

Instantly share code, notes, and snippets.

@akamola

akamola/arraykeys.php

Last active Nov 5, 2016
Embed
What would you like to do?
PHP: Find all entries of an array whose keys starts with "barfoo-"
<?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
You can’t perform that action at this time.