* Thus wrote Christopher J. Crane ([EMAIL PROTECTED]):
> Is this the best way to do this?
> 
> if(isset($Task) && $Task == "Add") { Do something }
> 
> I want to check if the variable is set and if so, if it is "Add".

Yes, that is good. Remember, though, it is case sensitive so "ADD"
wont match. 

Concerning the $Task == "Add", I'd like to make a comment.  It can
be a wise decision to compare your variables with strings like:

if ("Add" == $Task)

This can help preventing typo's  like:

if ($Task = "Add")

I've seen people tear their hair out wondering why the if statement
is always true even if $Task is not "Add". I don't see this method
used very often but it can prevent serious logic typos.


HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to