PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
//*********************************
// What the hell is going on?
//*********************************
$columns = 3;
$a = '0';
while (list ($key, $val) = #each ($itemname)) {
//$columns is how many columns are in your table once $a reaches the value of
//$columns it will terminate the row in the table and create another one.
if ($a % $columns == 0) // LINE 49
{
echo "</TR>";
echo "<TR>";
}
echo "<TD ALIGN=CENTER VALIGN=CENTER>";
?>
$a = '0';
if ($a == 0) {
// do stuff here
}
if ($a == '0') {
// do stuff here
}
Both of these if statements would run. However, if you used the approach of using === for your comparisons, then it would only recgonzie the string '0' as being equal as it does a true comparison and doesn't do any type conversions.