[PHP] If statement within a variable?

2001-08-30 Thread Brandon Orther
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

Re: [PHP] If statement within a variable?

2001-08-30 Thread Andrey Hristov
] 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

Re: [PHP] If statement within a variable?

2001-08-30 Thread Jack Dempsey
$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

Re: [PHP] If statement within a variable?

2001-08-30 Thread * RzE:
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

Re: [PHP] If statement within a variable?

2001-08-30 Thread Franklin van Velthuizen
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

Re: [PHP] If statement within a variable?

2001-08-30 Thread * RzE:
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

Re: [PHP] If statement within a variable?

2001-08-30 Thread Alexander Skwar
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 ==