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
 Random To File     -  
 php Random quote     -  
 php Random image     -  
 Random to File     -  
 Array difference for associate array     -  
 random forest algorithm classifier     -  
 Generating Random Number in java     -  
 Random Search for tuning classifier parameters     -  
 Get the important variables of random forest classifier     -  
 Applet Game To Shot a Random Ball     -  

Topic Tags

PHP Arrays