PHP file handling functions
Reading a fileWe 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. Read MoreWriting to a fileWe must have write permission to enter data to a file. We have to open the file in write mode and then enter data. Read MoreDeleting filesHow 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. Read Morefile_existsChecking if file exists or not before executing any code block. Read MoreDeleting all filesCan we delete all files from a directory? How to give the command. Read MoreDownloading files from serverWe 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. Read MoreDisplay all files of a directoryWe can display all files present inside a directory. Read MoreHow to get current file nameWe 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. Read MoreLast modified time of a fileWhen was last time the file was modified? How to get the last modified time of a file?Read MoreDisplaying last updated time of the fileWe can use the function to get last modified time of the file and display the same within the file. Read MoreSearching text between two landmarks of a fileWe 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. Read MoreAll titles of files present inside a directoryWe 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. Read MoreHow to upload images or files to serverHow 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. Read MoreMultiple file uploadWe can upload more than one file at a time. Learn how to handle multiple files at the same time to upload. Read MoreThumbnails image generationWe 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. Read MoreSample Projects using file and directory functionsSome projects on how to mange file and directory to develop complex scripts using database![]()
This article is written by plus2net.com team.
https://www.plus2net.com
![]() | ||||||
| ||||||