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

isset(“variable”);

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

 

Leave a Reply

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

9 + 6 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">