I
I
Ilya Parshakov2016-03-12 15:11:27
PHP
Ilya Parshakov, 2016-03-12 15:11:27

How to fix the array output on the page?

Hello.
For example, there is an array with wordpress users, I want to mix it up and display it on the page in the order received. How can I make the output fixed on the page and this wordpress page could then be accessed and see this list?

$users = get_users();
shuffle($users);

print_r($users);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IIISpikerIII, 2016-03-14
@IIISpikerIII

As an option, store a serialized list of user ids in the field of the table responsible for storing the settings. Accordingly, when shuffling users, we write the result to this table and take it when requested.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question