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. why it is( ((year % 4 == 0) && !(year % 10
View Tutorial          By: Jai Shankar K at 2012-04-08 10:15:56

2. i want diff example one.....

plz
View Tutorial          By: Santhosh at 2010-07-30 01:35:22

3. main method's return type is void .how main methad
View Tutorial          By: sayyed moin at 2015-09-07 08:55:33

4. Nice Work... Keep it..
View Tutorial          By: Ashok at 2010-02-28 05:12:31

5. we know how declare constructor and methods but we
View Tutorial          By: sreekanth at 2011-05-04 02:49:29

6. i really hate do while loop statement, can u pls h
View Tutorial          By: mARjO at 2011-09-01 03:50:18

7. i cannot add attachment
its saying
&

View Tutorial          By: Rintu Das at 2012-05-04 18:07:48

8. I wanna to name ,subject and marks of every subjec
View Tutorial          By: raveesh yadav at 2012-10-13 19:56:47

9. Good article
View Tutorial          By: Manu Francis Mathew at 2009-12-18 00:50:45

10. gr8t man.....! i am satisfied with ur explanation
View Tutorial          By: raja deepa at 2011-07-05 13:44:21