Re: [PHP] if inside an echo.
- From: neil.freeman@xxxxxxxxxx (Neil Freeman)
- Date: Tue, 31 Jul 2007 17:04:23 +0100
Or another way...
for ($value = 0; $value <= 2000; $value += 100)
{
echo sprintf("<option value=\"%s\"%s>%s</option>", $value,
(($min_rent==$value) ? " selected=\"selected\"" : NULL), $value);
}
Hulf wrote:
**************************
This Email Has Been Virus Swept
**************************
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>";
}
*******************************************************************
ATTENTION: E-mail addressed to the
addressee@xxxxxxxxx will only be delivered for a limited
period. Please update your address book using the
"From" address on this e-mail.
This communication is confidential to the intended
recipient(s). If you are not that person you are not
permitted to make use of the information and you are
requested to notify the sender immediately of its receipt
and then destroy the copy in your possession. Any views
or opinions expressed are those of the originator and may
not represent those of L-3 Communications ASA Ltd.
Sent from L-3 Communications ASA Ltd.
Registered in England and Wales Company No. 1730717
Registered Office: 5th Floor, Chiswell Street, London EC1Y 4UP
*******************************************************************
This Email has been Virus Checked
*******************************************************************
.
- References:
- if inside an echo.
- From: "Hulf"
- if inside an echo.
- Prev by Date: Re: [PHP] US Salary Averages for Developers
- Next by Date: RE: [PHP] Unexpected values in an associative array
- Previous by thread: Re: if inside an echo.
- Next by thread: Array difficulty
- Index(es):