Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2000071

Re: [PHP] Regular Expresion Problem From: Andrei Zmievski (andrei <email protected>)
Date: 07/13/00

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 ( <email protected>) = 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>