thanks for your help bpat1434 i couldnt get ur example to work.
just for anyone who is doing a similiar thing this is how i eventually did it , im not the best php coder , but i understand how it works. taking the values from the bad arrays and replacing them with nothing.
$zeros = "";
if ($option1 == "1") { $good = array(1,2,3,4,5,6,7,8,9); }
if ($option1 == "2") { $good = array(1,2,3,4,5,6,7,8,9); }
if ($option1 == "3") { $good = array(2,5,6,7); }
if ($option1 == "4") { $good = array(2,5,8,9); }
if ($option1 == "5") { $good = array(2,5,6,7); }
if ($option1 == "6") { $good = array(2,5,6,7); }
if ($option1 == "7") { $good = array(1,2,5); }
if ($option1 == "8") { $good = array(1,2,5); }
if ($option2 == "1") { $bad1 = array(3,4,5,6,7,8,9); }
if ($option2 == "2") { $bad1 = array(8); }
if ($option2 == "3") { $bad1 = array(4,5,6,7,8,9); }
if ($option2 == "4") { $bad1 = array(1,2,3,5,6,7); }
if ($option3 == "1") { $bad2 = array(6,8); }
if ($option3 == "2") { $bad2 = array(7,8); }
if ($option3 == "3") { }
if ($option4 == "1") { $bad3 = array(1,3,4); }
if ($option4 == "2") { }
if ($option5 == "1") { $bad4 = array(1,3,4); }
if ($option5 == "2") { }
if ($option6 == "1") { $bad5 = array(4,5,6,7,8); }
if ($option6 == "2") { }
$cut = str_replace($bad1, $zeros, $good);
$cut2 = str_replace($bad2, $zeros, $cut);
$cut3 = str_replace($bad3, $zeros, $cut2);
$cut4 = str_replace($bad4, $zeros, $cut3);
$cut5 = str_replace($bad5, $zeros, $cut4);
unset($cut5['']);
while (list($key,$value) = each($cut5)) {
if ($value == "") { echo ""; } else {
echo "<a href=\"pdfs/$img\" class=\"noimg\" target=\"_blank\"><img src=\"binaries\fan_selector\.".$value.".gif\" class=\"images\"></a>";
}
}