Re: how to divide string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Zebic

It is pretty much simple./ Look into the code

$text = "abcdefghijklmnopqrstuwvxyz";
$newtext = wordwrap($text, 4, "<br>", 1);
echo $newtext;

// if you want all these chunks in an array use it as
$array = explode("<br>", $newtext);

echo $array[0];
echo $array[1];
echo $array[2];

Regards
Shafiq [http://www.phpgurru.com]


On 9/5/05, Adi Zebic <adi@xxxxxxxxxxxx> 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
> 
> 


-- 
*** phpgurru.com <http://phpgurru.com> [A php resource provider] ***

\\\|///
\\ - - //
( @ @ ) PHP is too logical for my brain
+---oOOo-(_)-oOOo------------------------------------------+
| Mian Shafiq ur Rehman
| phpgurru.com <http://phpgurru.com> [A php resource provider]
| 107 B, New Town, Multan Road
| Lahore Pakistan
|
| Mobile: 0300 423 9385
|
| ooo0 http://www.phpgurru.com
| ( ) 0ooo E-Mail: rehmanms@xxxxxxxxx
+---\ (----( )------------------------------------------+
\_) ) /
(_/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux