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. the example program that given above for recursion
View Tutorial          By: bharathi at 2012-07-17 09:31:14

2. Thanks alot. Really great and simple example!
View Tutorial          By: leo at 2011-06-06 13:58:32

3. the default implementation of validate returns nul
View Tutorial          By: Jerry at 2009-02-01 11:12:06

4. Please
Can you help me ^-^
I use th

View Tutorial          By: HNO11 at 2011-03-28 11:08:28

5. when i was running this code... it is giving me th
View Tutorial          By: Nilesh Agrawal at 2012-06-08 15:08:25

6. u hav done Nice job..
View Tutorial          By: Rakesh at 2012-10-01 16:00:14

7. Excellent Example...... To understand the concept
View Tutorial          By: SUNNY at 2009-02-24 23:41:04

8. Excellent explanation...Thanku.
View Tutorial          By: Rajpal Singh at 2012-12-29 05:36:20

9. Impressing answer guys...
View Tutorial          By: Jayeeta Pal at 2011-06-28 03:18:26

10. My Friend,

Thank you so much for ex

View Tutorial          By: Bikash at 2010-05-30 00:15:26