Función PHP rmdir()
❮ Referencia del sistema de archivos PHPEjemplo
Eliminar el directorio "imágenes":
<?php
$path = "images";
if(!rmdir($path)) {
echo ("Could not remove $path");
}
?>
Definición y uso
La función rmdir() elimina un directorio vacío.
Sintaxis
rmdir(dir, context)
Valores paramétricos
Parameter | Description |
---|---|
dir | Required. Specifies the path to the directory to be removed |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
Detalles técnicos
Valor devuelto: | VERDADERO en caso de éxito, FALSO en caso de fracaso |
---|---|
Versión PHP: | 4.0+ |
❮ Referencia del sistema de archivos PHP