Make array from checkbox form

后端 未结 8 1807
囚心锁ツ
囚心锁ツ 2020-12-09 11:42

My friend and I are making a website that compiles news stories based on your interests. Is there and easy way to take the checkbox data and make an array out of the selecte

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 12:01

    the HTML markup:

    Politics
    Movies
    World

    and in the php code:

    $checked = $_GET['options'];
    for($i=0; $i < count($checked); $i++){
        echo "Selected " . $checked[$i] . "
    "; }

提交回复
热议问题