Skip to content

Instantly share code, notes, and snippets.

@neilgee
Created June 30, 2016 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/db5fb83b52750b32ebe4642d060b4f0f to your computer and use it in GitHub Desktop.
Save neilgee/db5fb83b52750b32ebe4642d060b4f0f to your computer and use it in GitHub Desktop.
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