note 34231 added to function.reset

From: Date: Fri, 18 Jul 2003 23:54:07 +0000
Subject: note 34231 added to function.reset
Groups: php.notes 
Request: Send a blank email to php-notes+get-52368@lists.php.net to get a copy of this message
Here is a simple example on how to combine 2 arrays. Here we use array_combine() to create list of months and there respective month number. The same result could just as easily be achieved with array('1'=>'January') etc. <?php // make it or break it error_reporting(E_ALL); // create and array of keys $keys = range(1,12); // create an array of months $months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); // combine the arrays $combined_array = array_combine($keys, $months); // echo out the results foreach($combined_array as $k=>$v){ echo $k.' -> '.$v.'<br />'; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.reset.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34231 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34231&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34231&report=yes

« previous php.notes (#52368) next »