You are here: Re: [PHP] how to divide string « PHP « IT news, forums, messages
Re: [PHP] how to divide string

Posted by Jordan Miller on 09/06/05 02:04

If you are using php 5, don't forget about str_split, with 4 as the
second parameter.
http://us2.php.net/str_split

so you could do:
echo implode("<br />", str_split($string, 4));

if you still have php 4 or earlier, look at that page anyway as there
is a workaround function in the comments for earlier versions of php.

Jordan



On Sep 5, 2005, at 6:50 AM, Adi Zebic wrote:

> Hi,
>
> is there any magic function who can give me from:
>
> $string = " abcdefghijklmnopqrstuwvxyz";
>
> somthing like this:
>
> abcd
> efgh
> ijkl
> mnop
> qrst
> uwvx
> yz
>
> (each 'x' letters go to the next line)
>
> Thanks a lot,
>
> ADI
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.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

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