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

如何在wp-config.php中的wordpress数据库配置中定义和选择随机用户?,php,database,wordpress,Php,Database,Wordpress,如何使上述代码在wp-config.php中工作?谢谢。您也可以在第二个参数中设置随机用户的数量: $randomuser = array("user","user1","user2","user3","user4","user5"); shuffle($randomuser); /** MySQL database username */ define('DB_USER', $randomuser); .在wp-config.phpi中似乎不起作用。只希望随机选择1个用户并如上所述定义为D

如何使上述代码在wp-config.php中工作?谢谢。

您也可以在第二个参数中设置随机用户的数量:

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

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

.在wp-config.phpi中似乎不起作用。只希望随机选择1个用户并如上所述定义为DB_用户。我上面的代码似乎不起作用。
$random_users = array_rand($random_user,5); //gets 5 random users from array