PHP 8.4.24 Released!

Voting

: seven minus two?
(Example: nine)

The Note You're Voting On

Anonymous
16 years ago
Shuffle for all encoding formats

<?php

function unicode_shuffle($string, $chars, $format = 'UTF-8')
{
    for($i=0; $i<$chars; $i++)
        $rands[$i] = rand(0, mb_strlen($string, $format));
            
        $s = NULL;
            
    foreach($rands as $r)
        $s.= mb_substr($string, $r, 1, $format);
            
    return $s;
}

?>

<< Back to user notes page

To Top