if inside an echo.



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>";

}
.



Relevant Pages

  • Re: [PHP] if inside an echo.
    ... if inside an echo. ... I am outputting a selectbox and want to do the follwoing. ...
    (php.general)
  • RE: [PHP] if inside an echo.
    ... if inside an echo. ... I am outputting a selectbox and want to do the follwoing. ...
    (php.general)
  • Re: Possibile bug?
    ... I think it's not normal what's outputting to me... ... function foo() ... echo ''; ... Lavorate voi - schiavi dei soldi - che non sentite la puzza della ...
    (comp.lang.php)
  • Re: nested loops only loop once
    ... loops for two arrays was not outputting the desired results, ... combined both arrays into one while loop. ... echo "more html"; ...
    (comp.lang.php)
  • Re: Difference between cat and echo
    ... > "This is a test message" ... > However for the echo command I get "echo " in the subject but the body is empty. ... > This made me wonder and hence ask you guys, why does cat work in ... > outputting the message while echo doesn't? ...
    (Fedora)