Home > Article > Backend Development > How to use php str_shuffle function
php The str_shuffle() function is used to randomly shuffle all the characters in the string and return the shuffled string; the syntax is "str_shuffle(string)", and the parameter string specifies the string to be shuffled .
How to use the str_shuffle() function?
Function: Randomly scramble all characters in the string
Syntax:
str_shuffle(string)
Parameters:
string, required, specified to be scrambled Scrambled string
Description: Return the scrambled string
php str_shuffle() function example 1
<?php $i = "hello world"; $j = str_shuffle($i); echo $j; ?>
Output:
lhl drelow
php str_shuffle() function example 2
<?php $i = "php.cn is a good place for study php"; $j = str_shuffle($i); echo $j; ?>
Output:
ohd p odu cei ssr cgafypo tapphp .nl
The above is the detailed content of How to use php str_shuffle function. For more information, please follow other related articles on the PHP Chinese website!