Reply to Re: Extracting values from string

Your name:

Reply:


Posted by Rich on 12/01/06 19:27

On Fri, 01 Dec 2006 05:51:18 GMT, ABJAnton"
<jojoaffiliate@[NOSPAM]vancouver.com> wrote...
>
>I am trying to wrap my head around this one.
>
>I have a string full of keywords seperated by commas (,)
>
>Example string: "example1, example2, example3, example one, example two,
>etc"
>
>How would you extract each keyword and place it into an array?
>
>Thanks greatly
>
>
>

If the separator is consistent (e.g. comma or comma and space) you can use the
explode function....

$new_array = explode(",", $data);

You can also use preg_split() which handles regex, but the explode() function
would probably be the most efficient if you only had to work with a comma
separated list.

Rich
--
Help a Community by Participating in Ours
We donate your subscription fees to the charity you choose
100% of your first month, 10% thereafter.
http://newsguy.com/charity.asp

[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

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