Skip to content

Instantly share code, notes, and snippets.

View rattfieldnz's full-sized avatar

Rob Attfield rattfieldnz

View GitHub Profile
<?php
/*
* Task:
* Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz".
* For numbers which are multiples of both three and five print "FizzBuzz".
*
* Instructions:
* This file (fizzbuzz.php) can be uploaded to a webserver that's running PHP4+ and executed with "php fizzbuzz.php" from the command line.
* Alternatively, this file can be accessed directly (if webserver permissions allow) via your browser.