Question : 2D array help

Hello i have created this array code and i need to convert it in 2d array.

 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
<?php

 $arr  = array("1"=>"Jan", "2"=>"Feb", "3"=>"Mar","4"=>"Apr","5" => "May","6" => "Jun","7" => "Jul","8" => "Aug","9" => "Sept"); 


echo "<pre>";

foreach($arr as $time=>$item)
{
  echo "$month: $item\n";
}
echo "</pre>";

?>


How can i do it? Thank you

Answer : 2D array help

Here, see if this helps clarify things.  Install this code and run it to see the var_dump() output.  

If not, you just have to go back to your instructor and ask what to do.  Please show the instructor this thread.

Best of luck with it, ~Ray
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
<?php // RAY_temp_navax.php
error_reporting(E_ALL);
echo "<pre>" . PHP_EOL;

// CREATE AND DISPLAY A TWO DIMENSIONAL ARRAY

$arr = array
       ( 'Dogs' => array
                   ( 'Pomeranian' => 'Small'
                   , 'Chihuahua'  => 'Small'
                   , 'Terrier'    => 'Medium'
                   , 'Great Dane' => 'Large'
                   )
                   
       , 'Cats' => array
                   ( 'Siamese'   => 'Annoying'
                   , 'Persian'   => 'Hairy' 
                   , 'Cougar'    => 'Invisible'
                   , 'Tiger'     => NULL
                   , 'Lion'      => FALSE
                   )
        )
        ;
        
var_dump($arr);
Random Solutions  
 
programming4us programming4us