Re: Correct Coding

From: Date: Thu, 07 Aug 2003 17:21:29 +0000
Subject: Re: Correct Coding
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-158691@lists.php.net to get a copy of this message
That can generate an error if $Task was never assigned a value. Cheers, Rob. On Thu, 2003-08-07 at 13:17, Juan Nin wrote: > > 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". > > why don't just do: > > if($Task == "Add") { Do something } > > regards, > > Juan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------'

« previous php.general (#158691) next »