77 456
Assignments Done
Successfully Done
In July 2019

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions