note 67911 deleted from function.array-key-exists by felipe [email protected] Sun, 30 Dec 2007 12:53:36 -0800 Newsgroups php.notes Message-ID <[email protected]> Note Submitter: marzetti.marco at gmail.com ---- Returns the keys in $arr matching $pattern in a regex <?php function regex_array_keys ( &$arr, $pattern ) { $results[] = false; if( !is_array( $arr ) ) return false; while( !is_null( $key = key( $arr ) ) ) { if( preg_match( $pattern, $key ) ) $results[] = $key; next($arr); } reset( $arr ); return $results; } ?>