PHP isset() – Check If Variable Is Set

PHP isset() function

PHP isset() function is used to check if a variable has been set or not.
This can be useful to check the submit button is clicked or not.
The isset() function will return true or false value. The isset() function returns true if variable is set and not null.

PHP isset() function syntax


PHP isset() Example

The output is :

boolean true

lets another php form example to understand more about isset() function.

Here, we are do sum of two values, design php form with two textbox and one button control like :

When we run above php example while first time page load it will show error like below:

php isset
PHP isset() function example


In above code add isset() function code to remove above error while page loading.

The output of isset() function php example is :

PHP  isset() function example
PHP isset() function example


(Visited 203 times, 4 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *