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
] 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
--
PHP General Mailing List (http://www.php.net
$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
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
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.;
$var = Hello .($var2==1 ? Mr. Bean : New Comer);
/franklin
--
PHP General Mailing List
Original message
From: * RzE: [EMAIL PROTECTED]
Date: Thu, Aug 30, 2001 at 06:05:57PM +0200
Message-ID: [EMAIL PROTECTED]
Subject: Re: [PHP] If statement within a variable?
This is it:
$var = Hello.($var2 = 1 ? Mr. Bean : New Comer).To The Coffee House.;
/Original message
Reply
Oops
So sprach »Brandon Orther« am 2001-08-30 um 08:59:44 -0700 :
$var = Hello.IF($var2 = 1) { .Mr. Bean. } else { .New Comer. }.
$var = Hello . (($var2 = 1)?(Mr. Bean):(New Comer));
But why do you assign 1 to $var2?
To circumvent these kind of problems, I always write:
$var = Hello . ((1 ==
7 matches
Mail list logo