Using the array_rand function

This example shows how to use the array_rand function to pick a random entry from an array

<html>
<body>
<?php
$sites = array("Google" => "www.google.com", "yahoo" => "www.yahoo.com","programmershelp" => "www.proggrammershelp.net");
$randomWebsite = array_rand($sites, 2);
print_r($randomWebsite);
?>
</body>
</html>