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
The following is a general routine to handle array variables sent to a page, that are located among regular name/value variables.
Example php:
';
foreach($_REQUEST as $name => $value){
if (is_array($value)) {
echo "$name:
";
// Assign array to something more mnemonic
$items = $value;
foreach ($items as $item) {
echo " $item
";
}
} else {
echo "$name: $value
";
}
}
echo '
';
?>
Example Markup:
Example Output:
customerName: John
toppings:
bacon
cheese