feelexit
08-17-2004, 11:37 PM
I cannot believe i m asking question about if statement.
I just coudn't figure out wht it doesnot work.
if i comment out the || ($i == 0) from the if statement, following codes work, but i dont know why it doesnt work with || ($i == 0)
<?
$str = "";
$col = 3;
$i = 1;
$strProduct = array();
$strProduct[0] = "abc";
$strProduct[1] = "2233";
$strProduct[2] = "4444";
if ((sizeof($strProduct) % $col) == 0) || ($i == 0) // bug here. please help
{
$str .= 'tr>td>';
}
else
{
$str .= 'td>';
}
echo $str;
/**/
?>
I just coudn't figure out wht it doesnot work.
if i comment out the || ($i == 0) from the if statement, following codes work, but i dont know why it doesnt work with || ($i == 0)
<?
$str = "";
$col = 3;
$i = 1;
$strProduct = array();
$strProduct[0] = "abc";
$strProduct[1] = "2233";
$strProduct[2] = "4444";
if ((sizeof($strProduct) % $col) == 0) || ($i == 0) // bug here. please help
{
$str .= 'tr>td>';
}
else
{
$str .= 'td>';
}
echo $str;
/**/
?>
