 <p>If you are hoping to do a random choice using strings you need to put them in an array and do Array shuffle.</p> <pre><code>shuffle($array_of_filenames); echo $array_of_filenames[0]; </code></pre> <p>More examples: <a href="http://php.net/manual/en/function.shuffle.php" rel="nofollow">http://php.net/manual/en/function.shuffle.php</a></p>