Please note, this is a STATIC archive of website www.tutorialrepublic.com from 10 Sep 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
String Functions
Advertisements

PHP str_shuffle() Function

Topic: PHP String ReferencePrev|Next

Description

The str_shuffle() function randomly shuffles all the characters of a string.

The following table summarizes the technical details of this function.

Return Value: Returns the shuffled string.
Version: PHP 4.3.0+

Syntax

The basic syntax of the str_shuffle() function is given with:

str_shuffle(string);

The following example shows the str_shuffle() function in action.

<?php
// Sample string
$str = "Hello World!";

// Perform string shuffling
echo str_shuffle($str);
?>

Parameters

The str_shuffle() function accepts the following parameters.

Parameter Description
string Required. Specifies the string to shuffle.
Advertisements
Bootstrap UI Design Templates