如何在wp-config.php中定义和选择wordpress数据库配置中的随机用户?

时间:2012-11-11 08:03:16

标签: php database wordpress

$randomuser = array("user","user1","user2","user3","user4","user5");
shuffle($randomuser);

/** MySQL database username */
define('DB_USER', $randomuser);

如何使上述代码在wp-config.php中运行?感谢。

1 个答案:

答案 0 :(得分:0)

您也可以在第二个参数中设置您想要获得的随机用户数:

$random_users = array_rand($random_user,5); //gets 5 random users from array