Skip to content

Instantly share code, notes, and snippets.

@schalkburger
Created February 17, 2015 08:08
Show Gist options
  • Save schalkburger/b0a6766c55eefa3852d2 to your computer and use it in GitHub Desktop.
Save schalkburger/b0a6766c55eefa3852d2 to your computer and use it in GitHub Desktop.
Button or link split testing with rand()
<?php
$buttons = array(
'<a href="#">Link 1</a>',
'<a href="#">Link 2</a>');
srand(time());
$random = (rand()%2);
echo ("$buttons[$random]");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment