Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Output a random string in PHP
<?php
//add your strings to the array
$input = array(
"Where friendships flourish and grow",
"Where you are treated with respect",
"Where people are helpful and sincere",
"Where you feel safe and at home"
);
//output a random string
echo '<p><em class="statement">' . $input[array_rand($input)] . '</em></p>'; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment