<?php
function getRandomString($length = 8) {
$characters = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789');
for ($i = 0; $i < $length; $i++) {
$rand = '';
foreach (array_rand($characters, 5) as $k) $rand .= $characters[$k]; $string[$i] = $rand;
}
return $string;
}
PD9waHAKCmZ1bmN0aW9uIGdldFJhbmRvbVN0cmluZygkbGVuZ3RoID0gOCkgewogICAgJGNoYXJhY3RlcnMgPSBzdHJfc3BsaXQoJ2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVowMTIzNDU2Nzg5Jyk7ICAgIAoKICAgIGZvciAoJGkgPSAwOyAkaSA8ICRsZW5ndGg7ICRpKyspIHsKICAgICAgICAkcmFuZCA9ICcnOwogICAgICAgIGZvcmVhY2ggKGFycmF5X3JhbmQoJGNoYXJhY3RlcnMsIDUpIGFzICRrKSAkcmFuZCAuPSAkY2hhcmFjdGVyc1ska107CiAgICAgICAgJHN0cmluZ1skaV0gPSAkcmFuZDsKICAgIH0KCiAgICByZXR1cm4gJHN0cmluZzsKfQoKcHJpbnRfcihnZXRSYW5kb21TdHJpbmcoKSk7