background image

//给定数组值
$options = array('option 1', 'option 2', 'option 3');

$valid = true;
if (is_array($_GET['input'])) {
    $valid = true;
    //开始匹配复选框中的选择值
    foreach($_GET['input'] as $input) {
        if (!in_array($input, $options)) {
            $valid = false;
        }
    }
    if ($valid) {
        //process input
    }
}
?>