Home  >  Article  >  Backend Development  >  How to use php str_shuffle function

How to use php str_shuffle function

藏色散人
藏色散人Original
2019-05-23 13:12:272534browse

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 php str_shuffle function

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn