Return to Snippet

Revision: 77904
at October 23, 2019 21:51 by danparks


Initial Code
<?php 
$words = array('fox', 'hippo', 'dog', 'cat'); 
echo $words[rand(0, count($words)-1)]; 
?>

Initial URL


Initial Description
A quick snippet to rotate a series of words on page load using PHP.

Initial Title
PHP Random Spin

Initial Tags
php, array

Initial Language
PHP