PHP » PYTHON |
login |
register |
about
|
PYTHON str_shuffle
is this article helpful?
|
Python replacement for PHP's str_shuffle
[
edit
| history
]
import random chars = list(myStr) random.shuffle(chars) return ''.join(chars) str_shuffle(PHP 4 >= 4.3.0, PHP 5) str_shuffle — Randomly shuffles a string Description
string str_shuffle
( string $str
)
str_shuffle() shuffles a string. One permutation of all possible is created. Parameters
Return ValuesReturns the shuffled string. Examples
Example #1 str_shuffle() example
<?php
|
more
Recently updated
more
Most requested
|