2
是否有一种更优雅或更高效的随机选择列表中字符串的方法?随机化字符串选择
$case = rand(1,4);
switch ($case) {
case 1: $message = "Check this out.";
break;
case 2: $message = "Dig this.";
break;
case 3: $message = "Listen to this.";
break;
case 4: $message = "Try out this.";
break;
}
把消息字符串数组,然后你可以用代码 – 2012-02-23 19:28:10