Skip to content

Instantly share code, notes, and snippets.

@jamierumbelow
Created January 20, 2014 14:44
Show Gist options
  • Save jamierumbelow/8521046 to your computer and use it in GitHub Desktop.
Save jamierumbelow/8521046 to your computer and use it in GitHub Desktop.
FreeAgent Referrer Code Competition
<?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];
~ ᐅ 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