I get an error on line 16... I have no idea what it is... 🙁
<?
/* Random quote script.
Could be used for quotes.
1. Create an array that will store the info that gets called randomly.
In this case, quotes.
2. Count how many entries are in the array.
3. Take one from that value, beause arrays start at zero.
4. Seed the random function.
5. Create a random number using the rand function, and put it in a variable.
6. Pick out the entry from the array that matches the random number.
7. Display the entry (quote).*/
// Create the array
$quotes = array("\"1\"", "\"2\"", "\"3\"", "\"4\"", "\"5\"", "\"6\"", "\"7\"", "\"8\"", "\"9\"",
"\"10\"", "\"11\"", "\"12\"", "\"13\"", "\"14\"", "\"15\"", "\"16\"", "\"17\""
"\"18\"", "\"19\"", "\"20\"");
// Count how many entries are in the array, and subtract one
$quotesCount = count($quotes) -1;
// Seed random function
srand((double)microtime()*1000000);
// "Randomize" -rand([int min, int max])
$randomNo = rand(0,$quotesCount);
// Grab a random entry from the Quotes array
$randQuote = $quotes[$randomNo];
// Display the random quote
echo "<font face='Verdana'>$randQuote</font>";
?>
Obviously it displays quotes. I put the numbers in there to test it before adding the quotes... And it gets an error on line 16 (quote"18"-"20")...
Any ideas as to what the problem may be?
Thanks.