Javatpoint Logo
Javatpoint Logo

PHP string str_shuffle() function

The str_shuffle() is in-built function of PHP. It is used to randomly shuffle all the character of a string. One Permutation of all possible is created.

Note: This function "str_shuffle()" does not generate cryptographically secure value. If we want to cryptographically secure then use it :

Random_int(), random_byte() etc.


Parameter Description Required/Optional
String Specify string to shuffle Required.

Example 1


Before using 'str_shuffle()':Hello PHP
Before using 'str_shuffle()':oP ePlHHl

Example 2

// In this program I have used, the output of the given above program. To check that it return randomly data or not. But when we will use "str_shuffle()" function then it will return randomly data.


Before using 'str_shuffle()':oP ePlHHl
Before using 'str_shuffle()':ePoll HHP

Note: This function returns randomly data so you can refresh your page then see.

Example 3


Before using 'str_shuffle()':12345
Before using 'str_shuffle()':15432

Next TopicPHP String

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA