Make array from checkbox form

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 selected checkboxes? Here is our form

<form action="signup.php" method="POST">
    Name: <input type="text" name="name" /> <br />
    Username: <input type="text" name="username"> <br />
    Password: <input type="password" name="pwd" /> <br />
    Email: <input type="text" name="email" /> <br />

    <p>By filling out this we will be able to find news articles that will interest you</p>        <br />
    Politics<input type="checkbox" name="interest[]" value="Politics" /> <br />
    Entertainment<input type="checkbox" name="interest[]" value="Entertainment" /> <br />
    Tech <input type="checkbox" name="interest[]" value="Tech" /> <br />
    Health<input type="checkbox" name="interest[]" value="Health" /> <br />
    Living<input type="checkbox" name="interest[]" value="Living" /> <br />
    Travel <input type="checkbox" name="interest[]" value="Travel" /> <br />
    World<input type="checkbox" name="interest[]" value="World" /> <br />
    Leisure<input type="checkbox" name="interest[]" value="Leisure" /> <br />
    Finance<input type="checkbox" name="interest[]" value="Finance" /> <br />
    Celebrity Gossip<input type="checkbox" name="interest[]" value="Gossip" /> <br />
    Movies<input type="checkbox" name="interest[]" value="Movies" /> <br />
    Sports<input type="checkbox" name="interest[]" value="Sports" /> <br />

    <input type="submit" value="Submit">
</form>

how would we make a php array using this data?

10
задан James Williams 2 August 2012 в 15:37
поделиться