I am trying to make a condition in php for this situation:
You can choose for a radio input or checkbox input. No matter what you choose, but if you choose one of them, it may not be empty.
$quickpolltype = "radio"; // set to "radio" or "checkbox"; radio is one choice, checkbox is multiple choices
I have seperated the 2 conditions now like below:
if($quickpolltype == "radio" and $_POST['radiovote'] != '') {
// do something
}
if($quickpolltype == "checkbox" and $_POST['checkboxvote'] != '') {
// do something
}
what i want to achieve:
No matter what you choose as type in $quickpolltype
, if the value of one of them is not empty --> do something
So how can i combine those 2 conditions in 1 condition, whatever quickpolltype is choosen?