Is there a way to simplify the following series of if / elseif statements, or are they correct as written?
Code PHP:if (($results[0][leather_stitch] == "Red") && ($results[0][model_year] == "2011" || "2012")) { $leather_stitch = 395; } elseif (($results[0][leather_stitch] == "Blue") && ($results[0][model_year] == "2011" || "2012")) { $leather_stitch = 395; } elseif (($results[0][leather_stitch] == "Yellow") && ($results[0][model_year] == "2011" || "2012")) { $leather_stitch = 395; } else { $leather_stitch = 0; }



Reply With Quote


Bookmarks