Re: PHP 5.1
| From: | Jason Garber | Date: | Mon, 06 Jun 2005 19:11:37 +0000 |
| Subject: | Re: PHP 5.1 | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-16463@lists.php.net to get a copy of this message | ||
Hello Sean,
I should have clarified this -- The following is how I do it all the
time. It's just a bit longhanded for something that is done so
often.
$email = (isset($_GET['email']) ? $_GET['email'] : '');
It get's even messier when you want to get something like this:
$value = (integer) (isset($myBigArray['SomeKey1']['SomeOtherKey']) ?
$myBigArray['SomeKey1']['SomeOtherKey'] : 0);
where
$value = ifsetor($myBigArray['SomeKey1']['SomeOtherKey'], 0);
is a bit cleaner.
Thanks.
--
Best regards,
Jason mailto:jason@ionzoft.com
Monday, June 6, 2005, 1:22:11 PM, you wrote:
SC> Jason Garber wrote:
>> If there was any way to accommodate this with userland PHP code, I
>> would have already done it. However it is an engine level function
>> that has to be added to the core of PHP.
SC> For the record, I also find ifsetor useful, but what you want can be
SC> accomplished like this:
SC> $email = isset($_GET['email']) ? $_GET['email'] : 'no email
address';
SC> ifsetor would make this much nicer, but there /is/ a way to accomplish
SC> what you want in userland.
SC> S