', '~', '+', '=', ',', '.' )); } $charsLen = count($chars) - 1; shuffle($chars); $password = ''; for($i=0; $i<$length; $i++){ $password .= $chars[mt_rand(0, $charsLen)]; } return $password; } }