Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Random text in PHP
<?
$random_text = array("Random Text 1",
"Random Text 2",
"Random Text 3",
"Random Text 4",
"Random Text 5");
srand(time());
$sizeof = count($random_text);
$random = (rand()%$sizeof);
print("$random_text[$random]");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment