String 函数
PHP 手册

str_shuffle

(PHP 4 >= 4.3.0, PHP 5)

str_shuffleRandomly shuffles a string

说明

string str_shuffle ( string $str )

str_shuffle() shuffles a string. One permutation of all possible is created.

参数

str

The input string.

返回值

Returns the shuffled string.

范例

Example #1 str_shuffle() example

<?php
$str 
'abcdef';
$shuffled str_shuffle($str);

// This will echo something like: bfdaec
echo $shuffled;
?>

参见


String 函数
PHP 手册