• « streamWrapper::stream_write
  • streamWrapper::url_stat »
  • PHP Manual
  • streamWrapper
  • Delete a file

streamWrapper::unlink

(PHP 5, PHP 7, PHP 8)

streamWrapper::unlink — Delete a file

Опис

public streamWrapper::unlink(string $path): bool

This method is called in response to unlink().

Зауваження:

In order for the appropriate error message to be returned this method should not be defined if the wrapper does not support removing files.

Параметри

path

The file URL which should be deleted.

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки.

Помилки/виключення

Виводить E_WARNING, якщо цей метод не вдалося викликати (напр. не реалізований).

Примітки

Зауваження:

Властивість streamWrapper::$context оновиться, якщо передано правильний контекст до функції виклику.

Прогляньте також

  • unlink() - Deletes a file
  • streamWrapper::rmdir() - Removes a directory