Re: [PHP] how to divide string

2005-09-05 Thread Jordan Miller
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("", 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 ear

Re: [PHP] how to divide string

2005-09-05 Thread Kevin Waterson
This one time, at band camp, Adi Zebic <[EMAIL PROTECTED]> wrote: > is there any magic function who can give me from: > > $string = " abcdefghijklmnopqrstuwvxyz"; > > somthing like this: > > abcd > efgh > ijkl > mnop > qrst > uwvx > yz $newstring=chunk_split("$string", 4, ''); Kevin -- "De

Re: [PHP] how to divide string

2005-09-05 Thread Shafiq Rehman
Hi Zebic It is pretty much simple./ Look into the code $text = "abcdefghijklmnopqrstuwvxyz"; $newtext = wordwrap($text, 4, "", 1); echo $newtext; // if you want all these chunks in an array use it as $array = explode("", $newtext); echo $array[0]; echo $array[1]; echo $array[2]; Regards Shafiq

[PHP] how to divide string

2005-09-05 Thread Adi Zebic
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.p