note 17321 added to function.array

From: Date: Tue, 04 Dec 2001 15:17:03 +0000
Subject: note 17321 added to function.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-21604@lists.php.net to get a copy of this message
I use this method to fill an array composed by many array with a cycle such as while, for... $i = 0; $main_arr = array (); while ($i < 3) { $main_arr["sub_arr_$i"] = array ("date"=>"2001-02", "option1"=>"value 1", "option2"=>"value 2"); $i++; } print_r($main_arr); it produce the following result: Array ( [sub_arr_0] => Array ( [date] => 2001-02 [option1] => value 1 [option2] => value 2 ) [sub_arr_1] => Array ( [date] => 2001-02 [option1] => value 1 [option2] => value 2 ) [sub_arr_2] => Array ( [date] => 2001-02 [option1] => value 1 [option2] => value 2 ) ) -- http://www.php.net/manual/en/function.array.php http://master.php.net/manage/user-notes.php?action=edit+17321 http://master.php.net/manage/user-notes.php?action=delete+17321 http://master.php.net/manage/user-notes.php?action=reject+17321

« previous php.notes (#21604) next »