$in='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+-_='; $out=substr(str_shuffle($in),rand(0,2),rand(5,8)); echo $out;