You are here: Re: Extract numbers from string « PHP Programming Language « IT news, forums, messages
Re: Extract numbers from string

Posted by john.d.mann@sbcglobal.net on 01/15/06 15:36

Charlie King wrote:
> (comp.lang.php) "zek2005" <esapoznik@gmail.com> wrote:
>>I have a varchar field in my DB with numeric values separates by
>>spaces. I need to extract the numbers to create an array.
>>Example 1: 1820 1823 1825 --> need to be transform into
>>1820
>>1823
>>1825
>
> $myArray = explode(" ", $myString)
>
> explode() splits up the string in its second argument at each
> ocurrence of the string in its first argument, and returns the results
> into an array.
>
> The manual http://fr.php.net/manual/en/function.explode.php
> gives good examples.
>
> Cheers
>

Exactly - I was going to say the same thing if no one else had yet :)

 

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

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