Returns the directory from a string.
EX: /test/ FROM /test/blah.php
Shows how to create functions, use explode(), count(), while() and preg_replace() functions.
A collection of 14 tips on PHP functions on file input and output. Clear answers are provided with tutorial exercises on opening files for reading and writing, appending data to existing files, reading file by line or character, reading file in binary mode. Special topics are:
How To Append New Data to the End of a File?
How To Read One Character from a File?
How To Read a File in Binary Mode?
How To Read Data from Keyborad (Standard Input)?
How To Open Standard Output as a File Handle?
Platform(s): Linux, Windows, FreeBSD, Mac OSX, Sun Solaris
A collection of 12 tips on uploading files with PHP pages. Clear explanations and tutorial exercises are provided on creating file upload HTML tags, setting encoding type on HTML forms, getting uploaded file information, storing uploaded file in database.
Platform(s): Linux, Windows, FreeBSD, Mac OSX, Sun Solaris
Seems more and more people are wanting to edit files on-line. Also a common problem in on-line editors is the textarea because editors on-line use the same code, so it breaks the editor. This will address this problem be tricking the the online editor into thinking it did not in fact load a file.
When I first started learning PHP I didn’t want to overload myself with learning about SQL as well, so I used text files for storage instead (also known as flat-file databases).
I am going to show you how to write information to a text file using PHP. You don’t have to have any PHP knowledge at all in order to follow this tutorial.
A collection of 8 tutorials on working with directories and files:
How To Create a Directory?
How To Remove an Empty Directory?
How To Remove a File?
How To Copy a File?
How To Dump the Contents of a Directory into an Array?
How To Read a Directory One Entry at a Time?
How To Get the Directory Name out of a File Path Name?
How To Break a File Path Name into Parts?
It is common to have downloads on your website, and sometimes you want to moderate your downloads by speed, or possibly hide the directory that the download is coming from, protecting all your other files. This is very possible and very simple to solve in PHP. All you need is the header() function and some files function.