Jump to content

Random array?


devWhiz

Recommended Posts

I dont know how to word this really. what I want to do is

 


$Var[] = 3;
$Var[] = 6;
$Var[] = 2;
$Var[] = 17;

for($i=0; $i!=count($Var); $i++)
{
echo "#$i: ".$Var[$i]."\n";
}

 

 

I know I might be able to use rand() but I need it to echo ALL of the variables in the array in a random order, I know if I use count to find out how many variables there are that it would echo them 4 times randomly but might echo the same variable 2 times making it to where it only echos 3 different varables, if I am being confusing please let me know, I just want to get this resolved, thanks!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/237721-random-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.