Randomly sort an array using PHP’s shuffle() function

If you ever need to randomise a PHP array, and want to do it in one line, use the shuffle() function. It’s especially useful when you just want to draw one array member randomly, like in a lottery or something.

$values = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); 
shuffle($values); //randomise the array members
echo array_pop($values); //outputs a random number from $values

What kind of gamer are you? The Bartle Test

This isn’t just one of those regular facebook style stupid social quizzes, this is a real psychological categorisation test to see what kind of gamer you are, mostly in an MMO context but for me it definitely extends to other types of games.

I’m firmly in the Explorer camp, which was confirmed recently at #PAXAus where I needed to see and buy ALL THE THINGS.

See for yourself: http://www.gamerdna.com/quizzes/bartle-test-of-gamer-psychology