private function make_code(){ $str = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $return_str = ''; $str_len = strlen($str); for ($i = 0;$i < 6;$i++){ $randnum = mt_rand(0,$str_len - 1); $return_str .= str_shuffle($str)[$randnum]; } return $return_str; }