3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hash = md5('haha'); // generate a random string $arr = str_split('ABCDEFGHIJKLMNOP'); // get all the characters into an array shuffle($arr); // randomize the array $arr = array_slice($arr, 0, 6); // get the first six (random) characters out $str = implode('', $arr); // smush them back into a string // return the file name echo hexdec(substr(sha1($str), 0, 7)) . $hash;

preferences:
39.87 ms | 402 KiB | 5 Q