Comment on Tutorial - isset() function in PHP By Emiley J.



Comment Added by : Bijan

Comment Added at : 2012-09-21 20:49:41

Comment on Tutorial : isset() function in PHP By Emiley J.
The !isset() is basically checking if the string is NOT true.
Take the first example:
if (isset($first_name)) {

print '$first_name is set';

}
This checks if the var $first_name has been declared. In plain English, if user hasn't filled out the form "First Name" yet then it will return false when he submit it.
Now:
if (!isset($first_name)) {

//So the $first_name is not set obviously, not you want to notify the user that he must
//have it filled

print 'Please fill out your First Name';

}
For this one you are checking if the $first_name has NOT been declared. The "!" means "NOT", this is listed in the operators http://www.w3schools.com/php/php_operators.asp
There are two or more ways to do this and it depends on what your are tying to achieve.
I am not a "PRO" at php just yet since I just stated but you'll know this but reading the link I gave.Also please if I said something wrong please correct me. ^_^


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Its an excellent example to learn this concept!!
View Tutorial          By: Koustav Routh at 2009-12-18 11:19:03

2. Hi santhosh,
Try it ou

View Tutorial          By: Kiran at 2011-12-14 04:31:29

3. realy i enjoy it for visit your site. and i unders
View Tutorial          By: vinod balot at 2015-02-09 17:43:30

4. Iwant javascript or Android.Thankyou
View Tutorial          By: bahman at 2013-01-01 01:27:20

5. nice effort
View Tutorial          By: Tiger at 2011-07-06 02:17:13

6. Good explaination, easy to understand
thank

View Tutorial          By: channaveer at 2010-05-02 05:03:21

7. Abstract class is a class that can not be instanti
View Tutorial          By: Abstract at 2011-07-19 01:14:09

8. good
View Tutorial          By: saravanan at 2007-03-02 23:16:00

9. hi all i receive below error can any one help me p
View Tutorial          By: Purushothaman at 2009-04-03 17:38:42

10. the below error can be solve by another version co
View Tutorial          By: prasad raju v at 2010-04-08 04:20:10