In: Computer Science
PHP Programming question!
Using Loop count from 0 to 300 by 15's
ex) 123456789101112131415
161718192021222324252627282930
.....
Code:
<?php
$count = 1; // declaring a variable to iterate
while($count <= 300) // looping from 1 to 300
{
echo $count;
if ($count%15 == 0) { // checking if its a multiple of 15
echo "\n"; // changing the line
}
$count++;
}
?>
Output: