Mega Code Archive
Categories
/
Php
/
Form
Validating a radio button
'E', 'toast' => 'T', 'coffee' => 'C'); foreach ($choices as $key => $choice) { echo "
$choice \n"; } if (! array_key_exists($_POST['food'], $choices)) { echo "You must select a valid choice."; } ?>