isset

From: Date: Tue, 15 Feb 2005 15:37:23 +0000
Subject: isset
Groups: php.general 
Request: Send a blank email to php-general+get-208737@lists.php.net to get a copy of this message
I often use this type of construct $cmd = $_POST['cmd']; if ($cmd == null) { // do default but this throws a notice if the ['cmd'] index is not defined. ugly. using if (isset($_POST['cmd'] ) { $cmd = $_POST['cmd']; } seems lengthy. is there a way around this? i tried using $cmd = @ $_POST['cmd']; to suppress errors but didnt seem to have ay effect. tx. -- _______________________________________________ David "DC" Collier mobile business creator |モバイル・ビジネス・クリエーター dc@pikkle.com skype: d3ntaku http://www.pikkle.com +81 (0)90-7414-6107

« previous php.general (#208737) next »