65 789
Assignments Done
99,4%
Successfully Done
In October 2018

Answer to Question #2123 in AJAX | JavaScript | HTML | PHP for Camille

Question #2123
How to randomly select 5 elements from an String Array?
Expert's answer
Some example:

$array = array('first', 'second', 'third', 'forth', 'fifth', 'sixth', 'seventh', 'eighth');

for ($i = 0; $i < 5; $i++)
{
$random = rand(0, count($array)-1);
print($array[$random].' ');
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions