Re: If statement within a variable?
| From: | Jack Dempsey | Date: | Thu, 30 Aug 2001 16:14:53 +0000 |
| Subject: | Re: If statement within a variable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65310@lists.php.net to get a copy of this message | ||
$var = $var2==1 ? 'Hello Mr. Bean' : 'Hello New Comer';
be careful of your if statements and only using one equals..
jack
Brandon Orther wrote:
> 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