RE: [PHP] Creating a variable out of a IF statement

From: Date: Wed, 16 Oct 2002 03:34:17 +0000
Subject: RE: [PHP] Creating a variable out of a IF statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120099@lists.php.net to get a copy of this message
> What I want to do is have an IF statement which the results would create a > variable. The IF statement is: > > IF ($car == "BMW" AND $model == "530i") echo ("Price is 35,000 dollars"); > > I want the "Price is 35,000 dollars" to be a variable. Please help with > how > to do this. if($car == "BMW" && $modle == "530i") { $var = "Price is 35,000 dollars"; } ---John Holmes...

« previous php.general (#120099) next »