Re: Like ternary but without the else.

From: Date: Fri, 25 Feb 2005 22:10:06 +0000
Subject: Re: Like ternary but without the else.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-209430@lists.php.net to get a copy of this message
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? > > <?php > > if($something) > { > $this = $that; > } > > ?> > $this = $something ? $that : null; -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.general (#209430) next »