From: "Daniel P. Brown" on 21 May 2010 17:08 On Fri, May 21, 2010 at 17:02, MuFei <mufei4u(a)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(a)parasane.net || danbrown(a)php.net http://www.parasane.net/ || http://www.pilotpig.net/ We now offer SAME-DAY SETUP on a new line of servers!
From: MuFei on 22 May 2010 10:22
Yes, I got it now. Thanks Daniel Thanks everyone! On Sat, May 22, 2010 at 12:08 AM, Daniel P. Brown <daniel.brown(a)parasane.net> wrote: > On Fri, May 21, 2010 at 17:02, MuFei <mufei4u(a)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(a)parasane.net || danbrown(a)php.net > http://www.parasane.net/ || http://www.pilotpig.net/ > We now offer SAME-DAY SETUP on a new line of servers! > |