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



Ask a Question

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. great explaination !!!
View Tutorial          By: aman at 2012-10-02 06:55:55

2. while i am executing this program i am getting Nul
View Tutorial          By: Seema at 2013-11-26 18:39:15

3. easy.......
View Tutorial          By: Suman at 2011-07-20 07:04:28

4. Your explanation is good but, it will be better i
View Tutorial          By: Jabaraj at 2010-03-22 06:02:33

5. Hi,.
No Change yaar, Im still getting the s

View Tutorial          By: Dinesh Rajendiran at 2012-03-23 05:19:06

6. Easy to understand... thank u....
View Tutorial          By: saranya at 2013-02-11 10:37:07

7. Hi
Its nice example ..
som

View Tutorial          By: munirasu at 2011-04-01 06:38:46

8. thanx mitra...it helped alot.
View Tutorial          By: psuyog at 2014-10-10 12:16:26

9. it s good ,understanding clearly and with out conf
View Tutorial          By: vasudeva kumar at 2012-01-06 14:04:30

10. thanks man really very nice and helpful...........
View Tutorial          By: Bakhtawar khan at 2012-12-05 05:54:18