SyntaxFix
Write A Post
Hire A Developer
Questions
PHP, using MT:
$items_array = array("alpha", "bravo", "charlie"); $last_pos = count($items_array) - 1; $random_pos = mt_rand(0, $last_pos); $random_item = $items_array[$random_pos];