I'm assuming you are submitting a form, where the field name
is empty, but it exists (or in other words isset).
The difference between isset
and empty
is, that the latter assumes that $_POST['name']
exists, but contains an empty value, e.g. ""
or 0
, whereas the first only checks if $_POST
contains an element name
.
When your form contains a field, it will be submitted and therefore is set, whether it has any contents or not (i.e. is empty).