Hey all,
Perhaps someone can give me some hints to the right direction here. I have two arrays, the data in them should always match up.. in the example below, 1 should always be with w1 and 2 should always be with w2 etc. I have a form that will shrink(or grow) the $weeks array.
$week_values = array('1','2','3','4','5','6','7','8','9','10');
$weeks = array('w1','w2','w3','w4','w5','w6','w7','w8','w9','w10');
$week_count = count($weeks);
for ($i=0; $i < $week_count; $i++) {
echo $week_values[$i]. " / ".$weeks[$i] ."<br>";
}
The problem I am having is that the $weeks array may shrink or grow at both ends at the same time or at one or the other end while the $weeks_values array will stay the same.
$week_values = array('1','2','3','4','5','6','7','8','9','10');
$weeks = array('w3','w4','w5','w6','w7','w8');
With that being said, I would then need to gather only the values from $week_values that match with the values of $weeks.. eg skip 1 and 2, but get 3 through 8 and skip 9 and 10 from the example above. I can get it to do either the first numbers in the array or the last, but not both together. If I need to explain this a little better just let me know. Thanks for any advice!