I've noticed I've got quite a few repeated lines in my code.
$start = mktime(0, 0, 0, 3, 1, 2014);
$rate = 1 / 30;
$amount = number_format(floor((time() - $start) * $rate));
$id = array(
array("42706686", "rebel2america"),
array("100004055720670", "marquez.candace"),
array("100000756492404", "vince.goode.3"),
array("100007763585373", "laura.allen.75491"),
);
// 70% chance of red an 30% of green
$status = array(
array("red", "no"),
array("red", "no"),
array("red", "no"),
array("red", "no"),
array("red", "no"),
array("red", "no"),
array("red", "no"),
array("green", "yes"),
array("green", "yes"),
array("green", "yes")
);
$online = range(7, 21);
// create and assign a 'seed' value that changes
// every $duration and assign to mt_srand
$duration = 5;
$mins = date('i', strtotime('now'));
$seed = $mins - ($mins % $duration);
mt_srand($seed);
// use mt_rand to build an 'order by'
// array that will change every $duration
$orderBy = array_map(function() {
return mt_rand();
}, range(1, count($id)));
// sort $ids against $orderBy
array_multisort($orderBy, $id);
$orderBy = array_map(function() {
return mt_rand();
}, range(1, count($status)));
array_multisort($orderBy, $status);
$orderBy = array_map(function() {
return mt_rand();
}, range(1, count($online)));
array_multisort($orderBy, $online);
for($i = 0; $i < 10; $i++) {
$results1 = array_pop($id);
$results2 = array_pop($status);
echo " <td>{$results1[0]}</td>\n";
echo " <td>{$results1[1]}</td>\n";
echo " <td><span class=\"{$results2[0]}\">{$results2[1]}</span></td>\n";
}