Add to Favorites

Random can be fun

Here is a snippet that will display a random sentence or phrase out on a php page.

--------------------------------------------------

$sentences = array(
'RRRRR Matey'
,'Take a chill pill'
,'Sit and relax'
,'On vacation we go'
);

$random_sentence = $sentences[ rand(0,count($sentences)-1) ];

echo $random_sentence;

---------------------------------------------------------

Comments

Be the first to leave a comment on this post.

Leave a comment

To leave a comment, please log in / sign up