PHP Programing language

adplus-dvertising
Using array rand to pick one or more random entries out of an array
Previous Home Next
<html>
<head>
<title>using array_rand</title>
</head>
<body>
<?php
   $a = array("Varanasi" => "Ramesh", "Allahabad"
   => "Rakesh","Kanpur" => "Rishikesh");
   $b = array_rand( $a , 2);
   print_r($b);
?>
<body>
</body>
</html>

Output:

Previous Home Next