delete() function in PHP


The delete() function deletes a file. The path of the file to be deleted is to be specified as a parameter.

Syntax

delete(file_path)

Parameters

  • file_path − Specify the path of the file to be deleted.

Return

The delete() function returns.

  • True, on success
  • False, on failure

Example

The following is an example. This deletes the file “amit.txt” specified as a parameter.

<?php
   echo delete("E:/list/amit.txt");
?>

Output

true

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 24-Jun-2020

416 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements