<Original message>
From: Brandon Orther <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]