1) $col++; // We've generated enough rows. if($row >= $lim) break; // Move to the right spot and print a *. if($row > $oldrow) { echo "\n"; for($i = 0; $i < $col; ++$i) echo ' '; } echo '*'; } ?>