I\'m new to PHP and trying to create the following whilst minimizing the amount of code needed. PHP should show a list of 100 then display if the number is / by 3, 5 or 3 and 5.
No need to do three if statements:
echo ""; for ($i = 1; $i <= 100; $i++) { echo "{$i}"; if ($i % 3 == 0) echo "BY3 "; if ($i % 5 == 0) echo "BY5"; echo "\n"; } echo "";