On 14 Feb 2002, at 22:18, Phillip S. Baker wrote:
> This is not a big thing.
> But I am looking at this thinking there is a way to make the code take
> up even less lines. Just want to stick this in my cap for future
> reference.
>
> for($i=01;$i<=50;$i++) {
> if (!empty($content)) {
> -Original Message-
> From: Joffrey van Wageningen [mailto:[EMAIL PROTECTED]]
> Sent: 15 February 2002 09:00
>
> i would try:
>
> for($i=01;$i<=50;$i++) {
> if(!empty($content) && $row[$content] == $states[$i])
> $selected = " selected";
> elseif($dstate == $states[$i])
>
);
}
I always prefer to use printf to mix content and data.
And why not use the || your reaching a single solution
Jerry Verhoef
>-Original Message-
>From: Joffrey van Wageningen [mailto:[EMAIL PROTECTED]]
>Sent: Friday, February 15, 2002 10:00 AM
>To: PHP Emai
> This is not a big thing.
> But I am looking at this thinking there is a way to make the code take up
> even less lines.
> for($i=01;$i<=50;$i++) {
> if (!empty($content)) {
> if ($row[$content]==$states[$i])
> echo " selected>$nstates[$i]\n
> Any expert programmers out there with the way to chop this
> even further?
I would suspect that chopping this further would make it
even harder to understand/maintain in the future...
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This is not a big thing.
But I am looking at this thinking there is a way to make the code take up
even less lines.
Just want to stick this in my cap for future reference.
for($i=01;$i<=50;$i++) {
if (!empty($content)) {
if ($row[$content]==$states[$i])
6 matches
Mail list logo