Yes, there is an IF that asks if it is odd, and no there are no for statements that check that. For statements are not conditional like that. I will say this though, you need curly braces, and not parenthesis after your FOR loop start...
Change:
for ($i = 0; $i < $totalfamilynumber; $i++)
(
if ($i % 2 != 0)
{
print "<option name=$membername[$i]>$membername[$i]</option>";
}
else
{
}
)
To:
for ($i = 0; $i < $totalfamilynumber; $i++)
{
if ( $i % 2 != 0 )
{
print "<option name=$membername[$i]>$membername[$i]</option>";
}
else
{
}
}
Also, the if part basically checks to see if the value of $i is odd, and prints out the option, and if it isn't, then it doesn't print anything out. Given that, you can clean up the code by getting rid of the else part:
for ($i = 0; $i < $totalfamilynumber; $i++)
{
if (($i != 0) || ($i%2 != 0))
{
print "<option name=$membername[$i]>$membername[$i]</option>";
}
}