You are here: Re: Separating Data « PHP Programming Language « IT news, forums, messages
Re: Separating Data

Posted by Bob Stearns on 06/24/06 05:22

J Huntley Palmer wrote:

> I am getting data lines with data separated by these 5 characters:
>
> , : ; <TAB> <whitespace>
>
> eg. foo,bar:baz foobar
>
> I would like to extract foo bar baz nad foobar.
>
> How can I parse out the data between or separated by them?
>
> Thanks!
$array = preg_split("[,;:\t ]", $string, -1, PREG_SPLIT_NO_EMPTY);

The last argument takes care of consecutive delimiters.

See URL: http://php.benscom.com/manual/en/function.preg-split.php

 

Navigation:

[Reply to this 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

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