View Single Post
  #2  
Old 16th August 2012, 10:35
arp arp is offline
Junior Member
 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default can be solved using loops

If I understand you correctly, this should work fine..

PHP Code:

$alphabet 
range('a''z');
$array = array();

for ( 
$i 1$i 6$i++ ) {
    foreach( 
$alphabet as $item ) {
        
$array[$i][$item] = str_repeat$item$i );
    }
}

# show debug ouptut
print_r $array ); 


which outputs

Code:
Array
(
    [1] => Array
        (
            [a] => a
            [b] => b
            [c] => c
            [d] => d
.....
    [2] => Array
        (
            [a] => aa
            [b] => bb
            [c] => cc
            [d] => dd
            [e] => ee
            [f] => ff
            [g] => gg
            [h] => hh
            [i] => ii
            [j] => jj
            [k] => kk
            [l] => ll
            [m] => mm
            [n] => nn
            [o] => oo
....
Reply With Quote