I have the following multiple checkbox selection:
Apple
$_POST['fruit_list']No, key fruit_list does not exist
To check if key exists in array better use array_key_exists because if you have NULL values isset returns false
But in your case isset is a good way
isset - Determine if a variable is set and is not NULL (have any value).
empty - Determine whether a variable is empty (0, null, '', false, array()) but you can't understand if variable or key exists or not
For example:
$_POST['test'] = 0;
print 'isset check: ';
var_dump(isset($_POST['test']));
print 'empty check: ';
var_dump(empty($_POST['test']));
$_POST['test'] = null;
print 'isset NULL check: ';
var_dump(isset($_POST['test']));
print 'key exists NULL check: ';
var_dump(array_key_exists('test', $_POST));
isset check: bool(true)
empty check: bool(true)
isset NULL check: bool(false)
key exists NULL check: bool(true)