Re: [PHP] If statement within a variable? From: * R&zE: (renze <email protected>)
Date: 08/30/01

<Original message>
From: Brandon Orther <orther <email protected>>
Date: Thu, Aug 30, 2001 at 08:59:44AM -0700
Message-ID: <006301c1316c$c9395010$0a00a8c0 <email protected>>
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 <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: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>