ftp_delete

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Deletes a file on the FTP server
<?php ftp_delete(FTP\Connection $ftp, string $filename): bool
<?php     function ftp_delete(...$arguments)

    {

        if ( ! is_mocked('ftp_delete')) {

            return \ftp_delete(...$arguments);

        }



        return return_mocked_value('ftp_delete');
<?php     private function deleteFile(string $path, $connection): void

    {

        $location = $this->prefixer->prefixPath($path);

        $success = @ftp_delete($connection, $location);



        if ($success === false && ftp_size($connection, $location) !== -1) {

            throw UnableToDeleteFile::atLocation($path, 'the file still exists');