PHP str_shuffle()Function

PHP String 参考手册PHP String Reference Manual

Examples

Randomly shuffle all characters in a string:

<?php
echo str_shuffle("Hello World");
?>

Run Example »

Definition and Usage

The str_shuffle() function randomly shuffles all characters in a string.


Syntax

str_shuffle(string)

Parameter Description
string Required. Specifies the string to be shuffled.

Technical Details

Return value: Returns the shuffled string.
PHP Version: 4.3.0+


PHP String 参考手册PHP String Reference Manual Other Extensions