Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Creates a directory
<?php ftp_mkdir(FTP\Connection $ftp, string $directory): string|false
<?php     function ftp_mkdir(...$arguments)

    {

        if ( ! is_mocked('ftp_mkdir')) {

            return \ftp_mkdir(...$arguments);

        }



        return return_mocked_value('ftp_mkdir');
<?php             }



            error_clear_last();

            $result = @ftp_mkdir($connection, $location);



            if ($result === false) {

                $errorMessage = error_get_last()['message'] ?? 'unable to create the directory';