PHP Random Spin


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. <?php
  2. $words = array('fox', 'hippo', 'dog', 'cat');
  3. echo $words[rand(0, count($words)-1)];
  4. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.