Reading a file We can read file in our server or external server by using fread function. We can create a pointer to the file and read the content by specifying the size of data to be collected. |
Writing to a file We must have write permission to enter data to a file. We have to open the file in write mode and then enter data. |
Deleting files How to delete files from a server? We should have permission and after deleting we can get a conformation message on success or failure of delete command. |
file_exists Checking if file exists or not before executing any code block. |
Deleting all files Can we delete all files from a directory? How to give the command. |
Downloading files from server We can give data to our visitors in CSV or ZIP format to download. Once the command is given it should ask the visitor to save the file in local computer. |
Display all files of a directory We can display all files present inside a directory. |
How to get current file name We can develop a common code which can be plugged into any file. But here the file name of the file may be required as a parameter. So we have to know the file name executing the code. |
Last modified time of a file When was last time the file was modified? How to get the last modified time of a file? |
Searching text between two landmarks of a file We can collect text between two landmarks of data present within a file. We can use the opening tag of title and closing tag of title as landmarks and collect the text used inside the title of the page. |
All titles of files present inside a directory We can display all titles of the files present inside a directory. We will be using directory handler to list all files and then use landmarks to collect the text within title of each file. |
How to upload images or files to server How to develop a simple script to upload files to the server through web browser. This basic script tell about the requirements of a simple file upload in a website. |
Multiple file upload We can upload more than one file at a time. Learn how to handle multiple files at the same time to upload. |
Thumbnails image generation We can create dynamically thumbnail of any uploaded image file. This can be used as a part of any image gallery script or any other type of script. |
file_get_contents() Getting file content as string |
file_size() Getting size of the file. |
Running file name Getting current running file name. |
pathinfo() |
Maximum execution time |
Sample Projects using file and directory functions Some projects on how to mange file and directory to develop complex scripts using database |
file_exists()
function in PHP?Manive | 17-06-2011 |
please add more directory tutorials using with php and mysql |