The difference and using method of PHP isset and unset

Source: Internet
Author: User

Many beginners will isset and unset to confuse, in fact, they are the difference between the two is very big, can say that there is no relationship oh, I think may be like it, so think so oh, then let's take a look at the grammar of Isset.

Isset (variable);

Description

Isset is used to determine whether a variable exists, if it returns true otherwise it returns false, and this variable is useful to us and we can use it to determine if a variable such as Get post is in OH.

Isset instance "

$a = "Test";
$b = "Anothertest";

echo isset ($a)? ' True ': ' false ';

The output is: true

Now let's take a look at the unset example.

$a = "Test";
$b = "Anothertest";

unset ($a);

echo isset ($a)? ' True ': ' false ';

The output is false;

You know why? Because Unset is the destruction of variables Oh.

Original site reproduced please specify www.111cn.net/phper/php.html

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.