PHP isset () and empty () the difference between the use of a detailed

Source: Internet
Author: User

Format: bool Isset (mixed var [, mixed Var [, ...])  

Function: Detects whether the variable is set  

return value:  

Returns FALSE&NBSP if the variable does not exist;
If the variable exists and its value is NULL, it also returns false 
TURE&NBSP is returned if the variable exists and the value is not NULL,
returns TRUE if each item meets the previous requirement when checking multiple variables, otherwise the result is false 
Version: Php 3, PHP 4, PHP 5 
More instructions:  
After releasing the variable with unset (), it will no longer be isset ().   the
PHP function isset () can only be used for variables, and passing any other parameter will result in parsing errors.  
detects if a constant is set to use the defined () function.  

php Empty () function to determine whether the value is null  

Format: bool Empty (mixed Var)  

function: Check whether a variable is empty  

return value:  

Returns TRUE&NBSP if the variable does not exist;
If the variable exists and its value is "", 0, "0", NULL, FALSE, Array (), Var $ var and an object without any attributes, the ture  is returned,
if the variable exists and the value is not "", 0, "0", NULL, FALSE, Array (), Var $var, and an object without any attributes, the false  is returned;
Version: PHP 3, PHP 4, PHP 5 
More instructions:  
Empty () return value =! ( Boolean) Var, but does not produce a warning message because the variable is undefined. See Convert to Boolean for more information.  
Empty () can only be used for variables, and passing any other parameter will cause Paser error and terminate the run.  
detects if a constant is set to use the defined () function.  

Source to: http://www.jb51.net/article/24666.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.