简体   繁体   中英

How do i define and select random user in wordpress database config in wp-config.php?

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

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

How do i make the above code to work in wp-config.php ? Thanks.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM