Home >Backend Development >PHP Tutorial > php处置复选框checkbox

php处置复选框checkbox

WBOY
WBOYOriginal
2016-06-13 13:18:551162browse

php处理复选框checkbox
php在得到checkbox的值时和asp有稍有不同,他得把表单多选框的名子命名成类似php中的数组形式: name[],如,要想得到checkbox的value数据关键也在于此。
例如:




php处理复选框checkbox实例


    $area_arr = array();
    if($_GET['action'] == 'submit'){
        $area_arr = $_POST['area'];
        echo "您选定的地区为: ";
        foreach ($area_arr as $key=>$v){
            echo $v." ";
        }
    }
?>

   


   


   


   


   


   


   




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn