How to use php str_shuffle function

藏色散人
Release: 2023-04-06 18:54:01
Original
2545 people have browsed it

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)
Copy after login

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;
?>
Copy after login

Output:

lhl drelow
Copy after login

php str_shuffle() function example 2

<?php
$i = "php.cn is a good place for study php";
$j = str_shuffle($i);
echo $j;
?>
Copy after login

Output:

ohd p odu cei ssr cgafypo tapphp .nl
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!