Re: Regular Expresion Problem
| From: | Andrei Zmievski | Date: | Thu, 13 Jul 2000 19:57:23 +0000 |
| Subject: | Re: Regular Expresion Problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6531@lists.php.net to get a copy of this message | ||
On Thu, 13 Jul 2000, Javier Leyba wrote:
>
> Hi !
>
> I'm porting a Perl application to PHP4. All went well till I've tried to split an
> string with the following code:
>
> in Perl the program did: my (@token) = split (/[^\w\+\-]/, $mio); ok
>
> in PHP I've tried to do: $token = split("/[^\w\+\-]/", $mio); without success.
>
> Could someone help me ?
Use this:
$token = preg_split("/[\w\+\-]/", $mio);
-Andrei
Any sufficiently advanced Operating System
is indistinguishable from Linux.
- Jim Dennis