<?php
srand((float) microtime() * 10000000);
$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
$rand_keys = array_rand($input, 2);
print $input[$rand_keys[0]] . "\n";
print $input[$rand_keys[1]] . "\n";
?>
参考资料:www.phptogether.com
本回答被提问者和网友采纳