$datadir, 'filename' => $filename]); } } function generate_hash(int $length) { $hash = ""; for($i = 0; $i < $length; $i++) { $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $random_char = $chars[rand(0, strlen($chars) - 1)]; $hash = $hash . $random_char; } return $hash; } ?>