some scripts or PHP functions to deal with file handling.
you can click on every built-in PHP function in the code to see the PHP manual entry for that function.

choose the function or script you need from the category “file handling”

delete file (download)

function to delete a file

download counter (download)

this downloader snippet will count downloads of files and helps to cloak the real address of the file downloaded. call like "thisscript.php?get=thefile_to_download"

file exists (download)

function to check if a file exists

file informations (download - demonstration)

this snippet will give you informations about a file like size, last modified date and more

file upload (download)

an easy file upload script. specify the filetypes allowed, the max filesize and the directory to upload the files.

include secure (download - demonstration)

This checks the name of the PHP file currently executing. If it is crackme.php , then the program dies before it gets to important code, because you didn't intend for anyone to execute this file on its own. If it is included in some other PHP file, then the $PHP_SELF variable will be something other than crackme.php, and the program will continue to execute.

line by line (download)

a rather lenghty solution for reading a file into an array

open file (download)

opens a file and returns the content as a string

read and select csv (download)

this functions read csv (comma seperated values) files and return the content as an array. the first one returns the whole file, the second acts like a select statement perfect for file-based databases

read file (download)

this will read a remote file and return the content as an array where each line is one item in the array.

strip file extension (download - demonstration)

this php code will strip the extension from a filename. to remove the extension just call the function with the name of the file

write to file (download)

function to write a string to a file

write to first line of file (download)

this snippet let's you insert data at the beginning of a file. it reads the contents and adds new data to the first line of the file. after this it joins the lines and writes them back to the file again.