Results 1 to 3 of 3
Thread: php if statement
-
08-17-2004, 11:37 PM #1Junior Guru Wannabe
- Join Date
- Dec 2003
- Posts
- 84
php if statement
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;
/**/
?>
-
08-17-2004, 11:53 PM #2Junior Guru Wannabe
- Join Date
- Apr 2004
- Posts
- 52
if ((sizeof($strProduct) % $col) == 0 || ($i == 0))
-
08-18-2004, 12:28 AM #3Web Hosting Guru
- Join Date
- Dec 2003
- Location
- Karachi, Pakistan
- Posts
- 320
Yes you were missing ) after this statement.
if ((sizeof($strProduct) % $col) == 0) || ($i == 0)Feroz Zahid
mail@feroz..