Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Pick one or more random entries out of an array

Tue Oct 28, 2008 1:20 am

Code:

<?php
   $states
= array("Ohio" => "Columbus", "Iowa" => "Des Moines","Arizona" => "Phoenix");
   
$randomStates = array_rand($states, 2);
   
print_r($randomStates);
?>




Post a reply
  Related Posts  to : Pick one or more random entries out of an array
 php Random image     -  
 Random to File     -  
 Random To File     -  
 php Random quote     -  
 Array difference for associate array     -  
 random forest algorithm classifier     -  
 Generating Random Number in java     -  
 Applet Game To Shot a Random Ball     -  
 Random Search for tuning classifier parameters     -  
 Get the important variables of random forest classifier     -  

Topic Tags

PHP Arrays