You are here: Re: string to array « All PHP « IT news, forums, messages
Re: string to array

Posted by Tom on 06/20/07 17:42

On Tue, 19 Jun 2007 15:16:02 +0200, Michael Fesser wrote...
>
>.oO(ana)
>
>>please help me with converting string to an array:
>>
>>I have a number for example 3567 that I wish to convert to an array for
>>example $arr=(3,5,6,7)
>>
>>I have seen in PHP manual that there is str_split function, but when I write
>>it in my Dreamweaver he does not recognize it like a function and it's not
>>working when I put on web.
>
>str_split requires PHP 5. You should upgrade if possible.
>
>>Is there some other function?
>
>You could try split() or preg_split() for example.
>
>Micha


On an older version of PHP you can probably use strlen() to figure out how long
the string is, then maybe use a for loop and substr() to step through the string
of numbers and array_push() to add to your array.

Tom
--
Newsguy.com - Express Accounts - 30 GB $9.95 / month

 

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

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