At 13:39 18-12-02 +0000, achillex wrote:
[EMAIL PROTECTED] (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 "-----_-_---","--_-_--","-_"
>
if (Preg_Match_All('~([-_]+)~S', $string, $matches)) {
        var_dump($matches);
}


or try ereg () with third argument.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to