|  | Posted by mantrid on 11/03/07 15:15 
HelloI wish to extract two arrays and use them simultaneously in a for each
 statement
 Ive tried
 'foreach ($yearsarray as &$yearvalue, $percentarray as &$percentvalue) {'
 and also
 'foreach ($yearsarray as &$yearvalue AND $percentarray as &$percentvalue) {'
 
 But neither work
 my full code for the function is below. Can anyone help
 
 ****************************
 Function taper_rel($aim,
 $yearsheld,$byrsheldgroup,$bpercentgroup,$nbyrsheldgroup,$nbpercentgroup){
 if($aim = 1){
 $yearsarray = explode(",", $byrsheldgroup);
 $percentarray = explode(",", $brpercentgroup);
 }elseif($aim = 0){
 $yearsarray = explode(",", $nbyrsheldgroup);
 $percentarray = explode(",", $nbrpercentgroup);
 }
 foreach ($yearsarray as &$yearvalue, $percentarray as &$percentvalue) {
 if ($yearsheld==$yearvalue){
 return $percentvalue;
 }
 }
 
 unset($yearvalue);
 unset($percentvalue);
 }
 **************************
 Thanks Ian
  Navigation: [Reply to this message] |