PHP str_shuffle() Function

Example

Randomly shuffle all characters in a string:

<?php
echo str_shuffle("I love Shanghai");
?>

Run Instance

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 scrambled.

Technical Details

Return Value: Return the scrambled string.
PHP Version: 4.3.0+