an better way to do this code

Posted by user295189 on Stack Overflow See other posts from Stack Overflow or by user295189
Published on 2010-05-26T06:10:03Z Indexed on 2010/05/26 6:11 UTC
Read the original article Hit count: 215

Filed under:
|
|

myarray[] = $my[$addintomtarray]
//52 elements

for ($k=0; $k <= 12; $k++){
echo $myarray[$k].' ';
}
echo '
';
for ($k=13; $k < 26; $k++){
echo $myarray[$k].' ';
}
echo '
';
for ($k=26; $k < 39; $k++){
echo $myarray[$k].' ';
}
echo '
';
for ($k=39; $k <= 51; $k++){
echo $myarray[$k].' ';
}

how to shorten this array code...all I am doing here is splitting an array of 52 elements into 4 chunck of 13 elements each. In addition I am adding formation with br and space

thanks

© Stack Overflow or respective owner

Related posts about php5

Related posts about cakephp