It's not out of range because of the reason you state. Using just raw numbers:
is 0, while:
is 65536.
A link would be pointless, all you would see is a random quote, it's PHP.
Here's a simplified version (only 2 quotes) that shows all you need to see what's what:
PHP Code:
<?php
$quotations = array(
"This is quotation one",
" ",
"This is quotation two.",
"North Carolina G.S. 90-210.25(c)(9)",
);
$noAuthor = " ";
$bigIndex = rand(0, (count($quotations) -1)) & 65534; // or $bigIndex = rand(0, (count($quotations) -1)) & ~1;
echo "<br /><br /><div class='quotations'> {$quotations [$bigIndex]} <br /><br /><div align='right'>";
if ($quotations [$bigIndex + 1] != $noAuthor) {
echo "- {$quotations [$bigIndex + 1]}";
}
echo "</div></div>";
?>
And really, all you need to play with the concept under discussion here is:
PHP Code:
<?php
$bigIndex = rand(0, 571) & 65534; // or $bigIndex = rand(0, 571) & ~1;
echo "$bigIndex";
?>
You can play with the numbers and see what you get. You can substitute various actual numbers for rand(0, 571) to have more control over the situation and thereby perhaps get more information from the results.
Bookmarks