Using Client-side scripts like – jQuery and JavaScript it is not possible to delete any files. Need to use Server-side scripting for doing it.
In PHP, you can simply use the unlink() function this removes a file from your server if it exists.
Sometimes you have the requirement to delete a resource file without reloading the page.
This cannot totally be done with PHP you need to use jQuery or JavaScript with it by which send AJAX request to your server for removing a file and according to the response make changes on your Client-side.
For demonstration purpose, I create some <img> elements with Delete Button. When the Button gets clicked then remove the file using jQuery AJAX and replace the <img> source with the default image.