Friday, February 21, 2014
How to delete a file using PHP
When I was working with a project with file uploads, I had a thought of deleting those files with php. unlink is used to delete a file from a folder. It takes the file path along with the file name as parameter. This funtion can be simply written as shown below.
unlink("path_to_img/file_name.extension");For example if you want to delete a text file sample.txt which inside the folder uploads then you need to use like this unlink("uploads/sample.txt);
You can use the same code to delete any file, just by changing the file extension.
Thank you very much. If you have any doubts just comment below. I'm always happy to help you.
Tags:
How to delete a file using PHP? How to delete a file from a folder using PHP? php code to delete a file
php code to unlink a file. from folder remove file using php .
remove files from folder using php
php script to remove files
php script to delet files
how can i remove file using php
how can i delete a file using php
php delete file
php file delete
php files delete using code
php deletion of a file
file deletion using php
delete an image using php
delete a photo using php
delete photo images with php
php code to delete photos
php photo deleting code
php function to delete photo
php function to remove images
php function to remove images photos and files
How to delete a file using php
how to delete an image from folder using php
how can i delete photo usnig php
Author: Bhanu Chander Bathini (CEO, Tricks Town.)
Hey friends, I am Bhanu Chander a Web Designer/Developer, Content writer, Freelance SEO analyst and a blogger. I am pursuing my M.Tech in Computer Science and Engg. You can contact me on bhanu4funn@gmail.com for web design solutions at low cost with effective SEO.
Tired of checking for new posts ?
Related Posts:
PHP Web Development
Subscribe to:
Post Comments (Atom)
0 comments: