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. It worked. Thank U!
View Tutorial          By: Abhijit Kurane at 2010-12-27 11:01:48

2. how to downlow the different 5 files please !!
View Tutorial          By: Agnin at 2009-06-24 05:29:09

3. voire pluse a des command java
View Tutorial          By: lahcine moubarek at 2009-02-16 01:59:17

4. thank you for your excellent explaination..! :)
View Tutorial          By: marios at 2012-05-16 16:17:31

5. hi i have doubt in strlen()........pls explain how
View Tutorial          By: ranjith at 2010-04-18 21:50:17

6. Hi.
How we can create list with menuitem in

View Tutorial          By: omid at 2008-09-08 02:09:50

7. It is not useful. bits2 is always changed. be care
View Tutorial          By: ash at 2011-07-25 23:13:30

8. I need complete steps for execution
Severa

View Tutorial          By: DASAn at 2011-08-10 10:10:36

9. Very Good Tutorial...
Very Good For Beginne

View Tutorial          By: Yatiraj Chakre at 2011-02-02 04:28:57

10. for me also The code gives the following exception
View Tutorial          By: ashitha at 2007-09-12 03:09:12