php - rand() to slelect array elements
i would like to Create an array() with the names of your closest family and friends.
After i've created my list, i need to sort it and randomly select a name from the list.
When you have your winning name, print it to the screen in caps so everyone knows how awesome the winner is.
Functions i'd like to use here: array(), array_push(), sort(), count(), rand(), and strtoupper(). code now:
<html>
<p>
<?php
// Create an array and push on the names
// of your closest family and friends
$family = array("jan","klaas","oma");
// Sort the list
sort($family);
join(", ", $family);
// Randomly select a winner!
$family rand(0, 2);
// Print the winner's name in ALL CAPS
?>
</p>
</html>
Answer
Solution:
since you need specific functions to be used here is the answer.