if inside an echo.

From: Date: Tue, 31 Jul 2007 11:10:32 +0000
Subject: if inside an echo.
Groups: php.general 
Request: Send a blank email to php-general+get-259882@lists.php.net to get a copy of this message
I am outputting a selectbox and want to do the follwoing. How can I add the IF statement inside the the echo? for ($value = 0; $value <= 2000; $value += 100) { echo "<option value=\"$value\" if ($min_rent==$value) {echo selected="selected" }> $value</option>"; }

« previous php.general (#259882) next »