Skip to content

Instantly share code, notes, and snippets.

@ackintosh
Created November 12, 2012 15:14
Show Gist options
  • Save ackintosh/4059901 to your computer and use it in GitHub Desktop.
Save ackintosh/4059901 to your computer and use it in GitHub Desktop.
fizzbuzz in php
<?php
for ($i = 1; $i <= 100; $i++) echo (($i % 15 === 0) ? 'fizzbuzz' : (($i % 5 === 0) ? 'buzz' : ($i % 3 === 0 ? 'fizz' : $i))) . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment