Must I test for Variable Existing as well as its Value?

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Must I test for Variable Existing as well as its Value?

Post by johnj » Tue Dec 11, 2012 5:31 am

To be safe, always use:

Code: Select all

if (isset($var) && $var == 'y')
{

}

Post Reply

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest