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



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. just remember to add
<uses-permission an

View Tutorial          By: Mouad at 2013-07-22 10:47:27

2. Can you give me an example to create InetAddress f
View Tutorial          By: Vaibhav at 2009-12-15 23:37:49

3. i want a java code to make a GUI in netbeans and s
View Tutorial          By: siddharth at 2012-03-17 09:59:59

4. Does Wait() inside synchronized create a race cond
View Tutorial          By: Aviator168 at 2010-04-21 16:02:06

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

6. it is really best site for the information.many ti
View Tutorial          By: panchanan ruata at 2013-05-22 09:36:37

7. hello,
i have running my bca IIIrd Year &a

View Tutorial          By: Narpat Dewasi at 2013-07-05 10:49:47

8. Wow Its awesome.
Thank you for giving such

View Tutorial          By: sukumar maji at 2010-07-25 12:47:30

9. I am quite new to Struts and this article, quite c
View Tutorial          By: Jenghiz at 2010-01-27 23:19:48

10. realy very nice artical it give good understable
View Tutorial          By: vivek at 2009-06-19 01:27:46