Reply to Re: split keywords into array

Your name:

Reply:


Posted by Rik on 07/24/07 17:16

On Tue, 24 Jul 2007 19:12:53 +0200, Geoff Berrow <blthecat@ckdog.co.uk> =
=

wrote:

> Message-ID: <op.tvy9w7siqnv3q9@metallium> from Rik contained the
> following:
>
>>
>>> Does anyone know what regular expression I would use to split text i=
nto
>>> an array, assuming the text can be separated by any non alphanumeric=

>>> character?
>>
>> $array =3D preg_split('/\W+/',$string,-1,PREG_SPLIT_NO_EMPTY);
>
> Thanks Rik. :-)
>


No problem.
BTW, if you also want to split on the underscore:
$array =3D preg_split('/(\W|_)+/',$string,-1,PREG_SPLIT_NO_EMPTY);
-- =

Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация