Created
January 20, 2014 14:44
-
-
Save jamierumbelow/8521046 to your computer and use it in GitHub Desktop.
FreeAgent Referrer Code Competition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* tl;dr - https://twitter.com/jamierumbelow/status/425274669152079872 | |
* | |
* The Story: | |
* | |
* I posted a message on Twitter asking if anybody used FreeAgent, and if they had a referral code. | |
* Upon referring a new customer, both you and 'the referred' get an lifetime discount. | |
* | |
* I receieved five replies almost instantaneously, from @chadtomkiss, @_beneverard, @IainMcPherson, | |
* @wolfl and @spamoom. Thanks guys! | |
* | |
* As I didn't want to show favouritism, I thought I'd write a quick script to pick, at random, a person | |
* from whom I could accept the referral code. | |
*/ | |
$people = [ 'chadtomkiss', '_beneverard', 'IainMcPherson', 'wolfl', 'spamoom' ]; | |
$upper_limit = count($people) - 1; | |
$person = rand(0, $upper_limit); | |
echo "And the winner is...." . PHP_EOL; | |
echo $people[$person]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ ᐅ php test.php | |
And the winner is.... | |
_beneverard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment