Re: Put text matching regex into array?
| From: | achillex | Date: | Wed, 18 Dec 2002 13:39:13 +0000 |
| Subject: | Re: Put text matching regex into array? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128707@lists.php.net to get a copy of this message | ||
eurleif@buyer-brokerage.com (Leif K-Brooks) wrote in news:3DFE7849.5050102
@buyer-brokerage.com:
> Is there a way to put each part of a string matching a regex into an
> array? Example:
> $string = "-----_-_--- --_-_-- random text here-_";
> $array = regextoarray($string,"[-_]{1,}");
> //Produces array of "-----_-_---","--_-_--","-_"
>
or try ereg () with third argument.