Jump to: navigation, search

Php str shuffle

From w3cyberlearnings

Contents

PHP function str_shuffle

This function randomly shuffles all characters of a string input.

Syntax str_shuffle

  • string: string to shuffle
str_shuffle (string)

Example 1

<?php
$str = "w3cyberlearnings.com";
$domain = str_shuffle ($str);
echo $domain;
?>

Output: Output will different each time you run this program

bsw3ceoi.magrelcnryn

Example 2

<?php

$str = "love";
$str_shuff = str_shuffle($str);
echo $str_shuff;
?>

Output

vloe

Related Functions


Navigation
Web
SQL
MISC
References