PHP Programing language

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

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: