Reply to using two arrays in a 'for each ..." statement

Your name:

Reply:


Posted by mantrid on 11/03/07 15:15

Hello
I 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация