How to display all array values once and in random order?
<p>I need a PHP script for my website in order to pick (all) values from an array and display them randomly.</p>

<p>Every value must be shown only once.</p>

<p>This is the code I've written so far, the problem is that the values are not taken once.</p>

<pre><code>&lt;?php
$one = 'SITE 1&lt;br&gt;&lt;br&gt;';
$two = 'SITE 2&lt;br&gt;&lt;br&gt;';
$three = 'SITE 3&lt;br&gt;&lt;br&gt;';
$four = 'SITE 4&lt;br&gt;&lt;br&gt;';
$five = 'SITE 5&lt;br&gt;&lt;br&gt;';

$array = array($one, $two, $three, $four, $five);
for ($i=0; $i&lt;5; $i++) {
    echo $array[rand(0, count($array) - 1)] . "\n";
}
?&gt;
</code></pre>

<p>You can test this code directly here: <a href="https://www.fabriziorocca.it/test/phprandom.php" rel="nofollow">https://www.fabriziorocca.it/test/phprandom.php</a></p>