I need your help with this, I mean ideas for content easy to generate. So far, things on my list are videos, equations and something I can’t mention here.
Since this is source section, here you go:
$n = -1;
$r = (1.0 * mt_rand ()) / mt_getrandmax (); // 0..1
if (isset ($_GET['n'])) {
preg_match ("/^\d\.\d+$/", $_GET['n'], $matches);
if (count ($matches) > 0) {
$n = 0 + $matches[0];
if (($n >= 0) && ($n <= 1)) {
// override random value
$r = $n;
}
}
}
else {
// $_GET['n'] is not set, send no-cache headers
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
}
// array helper
function pick ($arr) {
global $r;
return $arr [round ($r * (count ($arr) - 1))];
}
The rest is fairly obvious.