Chrome Extension

Delete a file in PHP

    $filePath = 'path/to/file';
    unlink($filePath); //THIS FUNCTION DELETES THE FILE
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now

To delete a file in PHP, you can use the inbuilt PHP function unlink($file). It requires a file path as its required parameter. This function will delete the file if found in the given location.

Search Index Data (The code snippet can also be found with below search text)

unlink() | PHP
Was this helpful?
Open Code Manager We are hiring