Re: Using if(isset()) with $_GET and switch and default
| From: | Daniel P. Brown | Date: | Fri, 21 May 2010 21:08:35 +0000 |
| Subject: | Re: Using if(isset()) with $_GET and switch and default | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305414@lists.php.net to get a copy of this message | ||
On Fri, May 21, 2010 at 17:02, MuFei <mufei4u@gmail.com> wrote:
> Hi Ashley,
> Your way works also great, But I have some question thought:
> When I only use the first half of the code you suggested:
> $question = (isset($_GET['question']));
> then use the $question in the switch it works as I want it.
> If I use the whole code( $question =
> (isset($_GET['question']))?$_GET['question']:'some default value
> here';), the results also are the same.
> My question is:
> What is the code from the "?"sign to the end for?
Ash gave you a ternary operator example.
http://php.net/manual/en/language.operators.comparison.php
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!