Función PHP desenlazar()
❮ Referencia del sistema de archivos PHPEjemplo
Eliminar un archivo:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
Definición y uso
La función unlink() elimina un archivo.
Sintaxis
unlink(filename, context)
Valores paramétricos
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to delete |
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+ |
Registro de cambios de PHP: | PHP 5.0 - Se agregó el parámetro de contexto |
❮ Referencia del sistema de archivos PHP