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. Awesome tutorial
View Tutorial          By: Anonymous at 2012-12-13 06:50:36

2. Hello, this is working fine with jpg file. But I w
View Tutorial          By: Ray at 2015-09-01 04:18:00

3. Nice one. I havn't thought of this before.
View Tutorial          By: Aniket Sawant at 2013-04-09 05:40:58

4. tnx.
i have problem why is that to slow???

View Tutorial          By: rozhin at 2015-08-21 07:54:42

5. Thanks for the syntax, this has really helped me u
View Tutorial          By: Ketobbey at 2010-04-30 19:01:29

6. The code is really helpfull...
reading or w

View Tutorial          By: sharda at 2010-03-11 03:28:02

7. Not bad,but need some implementation
View Tutorial          By: surjeet katwal at 2010-01-19 04:41:15

8. hello sir , i m student of mca . i am working on S
View Tutorial          By: Pallavi at 2013-04-06 13:53:54

9. Hi, I need the complete working code for sending a
View Tutorial          By: prakash at 2010-05-24 09:14:59

10. yes it is very good example for Abstract classes a
View Tutorial          By: obulreddy.G at 2010-07-13 22:52:41