note 87131 modified in function.preg-grep by danbrown
| From: | danbrown@php.net | Date: | Thu, 20 Nov 2008 15:25:26 +0000 |
| Subject: | note 87131 modified in function.preg-grep by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146765@lists.php.net to get a copy of this message | ||
<?php
/**
* Return the element key for a found pattern in an array
*
* @param String pattern
* @param Array input
* @return mixed
*/
function preg_array_key( $sPattern, $aInput ){
return key( preg_grep( $sPattern, $aInput ) );
}
?>
--was--
/**
* Return the element key for a found pattern in an array
*
* @param String pattern
* @param Array input
* @return mixed
*/
function preg_array_key( $sPattern, $aInput ){
return key( preg_grep( $sPattern, $aInput ) );
}
http://php.net/manual/en/function.preg-grep.php