<? $quotes = array(); $content = file_get_contents('quotes.txt'); //gets contents of the quotes.txt file $quotes = explode("::",$content); //makes an array of quotes after they are seperated $total_quotes = count($quotes); //counts the total number of quotes echo trim($quotes[mt_rand(0,$total_quotes-1)]); //echo a random quote :) ?> PHP: When I want to use a , instead of a :: it doesn't work. How can I make it work with , ? Thanks!
Did you mean explode them using comma as delimiter? If yes, you shouldn't, because quotes has a lot of commas?