Re: Question About Array

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

 



<?php
$country=array( "USA","KSA" ,"SYR","GER" ,"EGY","JPA" ,"CHA","PAK" );
$chunks = array_chunk($country, 3);
foreach($chunks as $chunk){
        echo implode(' ', $chunk), '<br />';
}
?>


 ====================================================
Nurul Ferdous
My Blog: http://www.dynamicguy.com/
My LinkedIn: http://www.linkedin.com/in/nurulferdous
====================================================




________________________________
From: saeedos <saeedos@xxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Tue, December 8, 2009 4:56:43 PM
Subject:  Question About Array

  
Hi all ,
i have this Array :
$country=array( "USA","KSA" ,"SYR","GER" ,"EGY","JPA" ,"CHA","PAK" );

// I want the output of this array looks like this :

USA  KSA  SYR
GER  EGY  JPA
CHA  PAK

i know it's can be done in Nested for loops , but i don't know how .

thanks 


 


      

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux