Brian Moon wrote: >>> $ConfirmCode = (isset($_GET['ConfirmCode']) ? $_GET['ConfirmCode'] : >>> ''); >> I agree that this is really a PITA, but until we get an operator for >> this, we should stuck on the ternary. > > > Another option is to use settype(); This has two advantages. One, if > the variable does not exist, settype creates it with an empty value of > the given type. Second, if it does exist, it can semitypecast them for > you. > > settype($_GET['ConfirmCode'], "string"); > > or > > $ConfirmCode = $_GET["ConfirmCode"]; > settype($ConfirmCode, "string"); But you still don't have a default value, just an empty default value(string, zero, etc.). You can't i.e. initialize $_GET["ConfirmCode"] with "Yes" using settype...
Regards, Cristiano Duarte -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php