When using PHP to write page programs, I often use variable processing functions to determine whether a variable value at the end of the PHP page is empty. At the beginning, I was used to using the empty() function, but I found some problems, so Use the isset() function instead and the problem is gone.
As the name suggests, empty() determines whether a variable is "empty", and isset() determines whether a variable has been set. It is this so-called "as the name implies" that made me take some detours at the beginning: when a variable value is equal to 0, empty() will also be true (True), so some accidents will occur. It turns out that although empty() and isset() are both variable processing functions, they are both used to determine whether the variable has been configured, but they have certain differences: empty will also detect whether the variable is empty or zero. When a variable value is 0, empty() considers the variable to be equivalent to being empty, which is equivalent to not being set.
For example, to detect the $id variable, when $id=0, use empty() and isset() to detect whether the variable $id has been configured. Both will return different values - empty() considers it not configured, isset () can get the value of $id: