|
|
| Files [+] Favor-It | |
| |
 |
| | Sort By:
|
This section of the PHP tutorial is completely dedicated to how PHP can interact with files. After completing this section you should have a solid understanding of all types of file manipulation in PHP! Author: tizag.com Code: PHP 4.0 |
Before you can do anything with a file it has to exist! In this lesson you will learn how to create a file using PHP. In PHP, a file is created using a command that is also used to open files. Author: tizag.com Code: PHP 4.0 |
Now that you know how to open and close a file, lets get on to the most useful part of file manipulation, writing! There is really only one main function that is used to write and it's logically called fwrite. Author: tizag.com Code: PHP 4.0 |
|  | |
My apologies for taking so long to actually get to the point where you get information from files. In this lesson we will teach you how to read data from a file using various PHP functions. Author: tizag.com Code: PHP 4.0 |
You know how to create a file. You know how to open a file in an assortment of different ways. You even know how to read and write data from a file! Now it's time to learn how to delete files. In PHP you delete files by calling the unlink function. Author: tizag.com Code: PHP 4.0 |
So far we have learned how to open, close, read, and write to a file. However, the ways in which we have written to a file so far have caused the data that was stored in the file to be deleted. Author: tizag.com Code: PHP 4.0 |
As we have mentioned before, when you open a file for writing with the paramater 'w' it completely wipes all data from that file. This action is also referred to as "truncating" a file. Truncate literally means to shorten. Author: tizag.com Code: PHP 4.0 |
|  | |
Before you can use PHP to manage your uploads, you must first build an HTML form that lets users select a file to upload. See our HTML Form lesson for a more in-depth look at forms. Author: tizag.com Code: PHP 4.0 |
In the previous lesson we used the function fopen to create a new file. In this lesson we will be going into the details of this important function and see what it has to offer.
Author: tizag.com Code: PHP 4.0 |
Icon Key >
 - Recently Updated
 - Showcase Listing
|