Skip to content

Instantly share code, notes, and snippets.

Last active Dec 16, 2015
What would you like to do?
str_shuffle(); A shorthand for generating random strings.
echo str_shuffle('ABCDEFGH');
// may returns HGACBDEF
// unicode shuffle (qeremy [atta] gmail [dotta] com)
function str_shuffle_unicode($str) {
$tmp = preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
return join("", $tmp);
echo str_shuffle_unicode('سلام');
// may returns مسال
/** A little snippet, collected by Ehsan **/
/** We Love PHP and any software writed with this **/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment