<?php
function createRandomStr($length){
$str = array_merge(range('a','z'),range('A','Z'));
shuffle($str);
$str = implode('',array_slice($str,0,$length));
return $str;
}
echo createRandomStr(4);