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
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
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
3 matches
Mail list logo