Re: [PHP] Like ternary but without the else.

2005-02-25 Thread Guillermo Rauch
On Fri, 25 Feb 2005 18:39:56 -0500, Brian V Bonini <[EMAIL PROTECTED]> wrote: > On Fri, 2005-02-25 at 13:36, Chris W. Parker wrote: > > How can I turn the following into something that resembles the ternary > > operator? > > > > > > > if($something) > > { > > $this = $that; > > } > > > >

RE: [PHP] Like ternary but without the else.

2005-02-25 Thread Chris W. Parker
Justin Lilly on Friday, February 25, 2005 3:10 PM said: > This should do the trick: > > $something ? $this=$that Actually that gives a synax error. But I've figured it out based on your suggestion. It's actually: Chris. -- PHP General Mailing List (http://ww

RE: [PHP] Like ternary but without the else.

2005-02-25 Thread Chris W. Parker
Jochem Maas on Friday, February 25, 2005 4:04 PM said: > just do: > > if ($something) $this = $that; >> Thanks! >> Chris. >> >> p.s. No need to respond if your suggestion is: >> >> > >> if($something) { $this = $that; } >> >> ?> :) -- PHP General Mailing Lis

Re: [PHP] Like ternary but without the else.

2005-02-25 Thread Jochem Maas
Chris W. Parker wrote: Hello, I couldn't find this anywhere on google or PHP's site but I'm pretty sure there's an answer to it. How can I turn the following into something that resembles the ternary operator? write an extension to the php engine? don't think it exists. if($something) { $t

RE: [PHP] Like ternary but without the else.

2005-02-25 Thread rich
I couldn't find this anywhere on google or PHP's site but I'm pretty sure there's an answer to it. How can I turn the following into something that resembles the ternary operator? is this what you're after? $this = ($something ? $that : $this) rich -- PHP General Mailing List (http://www.

Re: [PHP] Like ternary but without the else.

2005-02-25 Thread Brian V Bonini
On Fri, 2005-02-25 at 13:36, Chris W. Parker wrote: > How can I turn the following into something that resembles the ternary > operator? > > > if($something) > { > $this = $that; > } > > ?> $this = (isset($something)) ? $something : $that; The expression (expr1) ? (expr2) : (expr3)

Re: [PHP] Like ternary but without the else.

2005-02-25 Thread Justin Lilly
This should do the trick: $something ? $this=$that -justin On Fri, 25 Feb 2005 10:36:36 -0800, Chris W. Parker <[EMAIL PROTECTED]> wrote: > Hello, > > I couldn't find this anywhere on google or PHP's site but I'm pretty > sure there's an answer to it. > > How can I turn the following into som