Re: If statement within a variable?
| From: | * R&zE: | Date: | Thu, 30 Aug 2001 16:05:57 +0000 |
| Subject: | Re: If statement within a variable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65311@lists.php.net to get a copy of this message | ||
<Original message>
From: Brandon Orther <orther@webintellects.com>
Date: Thu, Aug 30, 2001 at 08:59:44AM -0700
Message-ID: <006301c1316c$c9395010$0a00a8c0@webintel>
Subject: [PHP] If statement within a variable?
> Hello,
>
> Is there a way to put an if statement in a variable?
>
> For example:
>
> $var = "Hello".IF($var2 = 1) { ."Mr. Bean". } else { ."New
> Comer". }."
> To The Coffee House.";
> Thank you,
> Brandon Orther
</Original message>
<Reply>
This is it:
$var = "Hello".($var2 = 1 ? "Mr. Bean" : "New Comer")."To The
Coffee House.";
</Reply>
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: renze@datalink.nl
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««