preg_grepPHP ManualPrevNextpreg_greppreg_grep -- Return array entries that match the patternDescriptionarray preg_grep(string pattern, array input);
preg_grep() returns the array consisting of
the elements of the input array that match
the given pattern.
Example 1. preg_grep() example 1
2 preg_grep("/^(\d+)?\.\d+$/", $array); // find all floating point numbers in the array
3
Note:
This function was added in PHP 4.0.PrevHomeNextpreg_quoteUpPattern Modifiers
Wyszukiwarka