lundi 30 octobre 2017

Randomise list of words in variable

I have variable which is list of words separated by comma like this:

$word_list = "word1, word2, word3, word4, word5";

Word list can contain more or less words than in example above.

How to randomise $word_list to get something like this:

word1, word5, word2, word3, word4

or

word4, word5, word3, word1, word2




Aucun commentaire:

Enregistrer un commentaire