ftp_mkdir

PHP 4, PHP 5, PHP 7, PHP 8
ftp_mkdir - Creates a directory
Manual
Code Examples

ftp_mkdir( FTP\Connection$ftp, string$directory ): string|false

Creates the specified directory on the FTP server.

Parameters

ftp

An FTP\Connection instance.

directory

The name of the directory that will be created.

Return Values

Returns the newly created directory name on success or false on error.

Exceptions and Errors

Emits an E_WARNING level error if the directory already exists or the relevant permissions prevent creating the directory.

Changelog

Version Description
8.1.0 The ftp parameter expects an FTP\Connection instance now; previously, a resource was expected.

Related Functions

Example of ftp_mkdir

Show all examples for ftp_mkdir

PHP Version: