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. Hi,

This is really urgent... my cod

View Tutorial          By: Benetha at 2012-04-09 05:57:45

2. hi.I am new in j2me and really want to learn more
View Tutorial          By: snehal at 2011-12-01 11:46:22

3. Very nice and easy to understand, keep it up !!
View Tutorial          By: claudiu at 2010-02-07 06:12:30

4. Thanks,It's perfect solution,I solved my probleam
View Tutorial          By: Suryaprakash Raghuwanshi at 2009-07-04 19:06:24

5. Very Useful example, Thanks
View Tutorial          By: Prabhat Kumar Singh at 2011-12-21 20:44:00

6. Good,

Thank you man.

View Tutorial          By: Goldo at 2010-07-12 14:56:14

7. its really helpful.thanks a lot
View Tutorial          By: bena at 2015-03-04 10:39:46

8. excellent to easy going
View Tutorial          By: murali at 2009-11-15 23:13:21

9. hai i have downloaded the above sms source code i
View Tutorial          By: arunram at 2009-10-28 01:42:51

10. So I followed you steps with no compile errors. W
View Tutorial          By: PointLookoutResident at 2014-10-14 19:01:11