Hello!  I am trying to reduce the size of the code below, which I believe
can be simplified.

I checked the 'for' entry in the manual as well as googling for some
similar code, but did not have any luck.

Here is what I have:


$ICON_COUNT="0";

if ($SHOW_WAI_ICON != "no")
{
        $ICON_COUNT++ ;
}

if ($SHOW_BOBBY508_ICON != "no")
{
        $ICON_COUNT++ ;
}

if ($SHOW_W3_ICON != "no")
{
        $ICON_COUNT++ ;
}

if ($SHOW_CSS_ICON != "no")
{
        $ICON_COUNT++ ;
}


Now I would like to make that a 'for' loop, but I'm not sure how to do it
in PHP.

In case it is not clear what I am trying to do, this is what I would do if
PHP syntax were like bash:

variables="SHOW_CSS_ICON SHOW_W3_ICON SHOW_BOBBY508_ICON SHOW_WAI_ICON"

for i in $variables
do

        if [ "$i" != "no" ]
        then
                #increment icon_count here
        fi

done


I'm just not sure about the nested syntax in PHP.

Thanks for any help

TjL


-- 
Site: www.tntluoma.com                       mailto:[EMAIL PROTECTED]
Info: Apache/1.3.19 (Unix) with PHP/4.0.6


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to