PHP str_shuffle() Function

Definition

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

Syntax

PHP str_shuffle() Function has the following syntax.

str_shuffle(string)

Parameter

ParameterIs Required Description
stringRequired. String to shuffle

Return

PHP str_shuffle() function returns the shuffled string

Example

Randomly shuffle all characters of a string:


<?php
echo str_shuffle("Hello World from java2s.com");
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions