str_shuffle
(PHP 4 >= 4.3.0, PHP 5)
str_shuffle — 文字列をランダムにシャッフルする
説明
string str_shuffle
( string $str
)
str_shuffle() は文字列をシャッフルします。 考えられるすべての順列のうちのひとつを作成します。
パラメータ
- str
-
入力文字列。
返り値
Returns the shuffled string.
例
Example#1 str_shuffle() の例
<?php
$str = 'abcdef';
$shuffled = str_shuffle($str);
// bfdaec のような文字列を返します
echo $shuffled;
?>