Hello, I am trying to set up a form to auto select a design in a menu and I'm having a problem with 2+ digit numbers... For example, request info for design 10. html?design=10 $design = $_GET['design']; $design = str_replace("0", "Select Design", $design); $design = str_replace("1", "Design 1", $design); $design = str_replace("10", "Design 10", $design); Design 10 menu output field = Design1Select Design How can I fix this so that my output menu field prints "Design 10"? Thanks
Try doing it this way, starting with the larger numbers: $match = array(10,1,0); $replace = array('Design 10','Design 1','Select Design'); $design = str_replace($match,$replace,(int)$_GET['design']); PHP: