A blog & community for non-professional web designers, programmers, webmasters, and other web savvies.

Shuffle String

February 28, 2011 - 12:00am -- Thomas

This script will mix up all characters in a string.

This could be used as a basic random password generator but you can't control the length unless you use another php function.

<?php
/*****************
--Shuffle String
--More PHP Scripts at
--http://icecaves.net/tags/php
*****************/
$text = "The characters in this string will be mixed in a random order.";
$output = str_shuffle($text);
echo
"<b>String:</b> $text<br><b>Result:</b> $output";
?>
Code Preview: 
String: The characters in this string will be mixed in a random order.
Result: airlxa ohT nrmsorrmawieecibsl nc r h init idhd gtder e satn.e
Tags: 
Forum Board: 

@IceCaves on Twitter

    Stay Connected

    Twitter Facebook Tumblr Google+ Glaciallis Google RSS

    *Follow us on Twitter or Facebook to also follow minor site updates that don't make it to the homepage news.