Re: ereg
| From: | Charles Killian | Date: | Tue, 20 Jun 2000 01:08:22 +0000 |
| Subject: | Re: ereg | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2262@lists.php.net to get a copy of this message | ||
You can try preg_grep to try and plow through the array:
preg_grep
(PHP4 )
preg_grep -- Return array entries that match the pattern
Description
array 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.