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. Good day. I managed to get the code working but I
View Tutorial          By: thabiso at 2011-06-03 09:08:24

2. can any body help me how to execute this code ....
View Tutorial          By: nikhil at 2009-06-04 23:10:30

3. thank's for the info.. i've learned a lot.. now, i
View Tutorial          By: farah talabo at 2012-01-08 23:55:14

4. thanks nice article , but there is bug as already
View Tutorial          By: YZ at 2011-08-05 13:10:49

5. does not work.

output:
./num

View Tutorial          By: praveen at 2012-08-30 19:04:20

6. I got a project on J2ME and i was to start to kno
View Tutorial          By: md kadir ali , vit university , vellore at 2010-05-12 00:59:58

7. Thanks
View Tutorial          By: Cecilia at 2012-08-07 05:05:51

8. Very helpful tutorial for me.
Thank you for

View Tutorial          By: Mohan at 2012-05-28 00:12:56

9. i want simple program of function used in recursio
View Tutorial          By: manish at 2009-05-19 01:03:19

10. Excellent tutorial thank you very much.

View Tutorial          By: Edd at 2012-01-15 10:49:00