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

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

Java program to check if user input is an even number

Archived Comments

1. sir, in this example,which value of n is being sto
View Tutorial          By: shivom at 2012-01-15 07:16:49

2. can I ask question? how to make a complete program
View Tutorial          By: manuel at 2012-08-13 10:06:24

3. i want daily tutorials
View Tutorial          By: ashish at 2007-12-18 04:26:19

4. good.
View Tutorial          By: Karthik at 2007-10-20 07:03:20

5. Thanks that made this concept of memory very cleat
View Tutorial          By: Tarak at 2009-06-24 07:58:04

6. I am getting a blank page. Closed the table tag an
View Tutorial          By: Harshal at 2013-02-19 14:56:35

7. very good tutorial..
View Tutorial          By: shobhit at 2010-05-04 12:17:41

8. it is very understandable thanku very much......
View Tutorial          By: manogna at 2010-10-13 02:24:06

9. It was actually useful!!! Thanks for explaining in
View Tutorial          By: steph at 2010-01-28 21:59:06

10. its easy to understand the complete history of jav
View Tutorial          By: Arun Tony at 2011-04-10 07:12:04