Working with text files
(Page 1 of 10 )
Learn how to perform different tasks with text files in this tutorial from Subhash Madhawa.
By : Subhash Madhawa
Welcome to my tutorial on "Working with text files"!
When you have an idea to design a website that has the ability to handle data inside it, normally you start off the project planning the database type, database structure, etc. Normally, the database type depends on the amount of records you'll handle and how often you will be accessing those records.
Depending on the amount of records, there are basically two ways of storing data: in a structured database or in a simple text file.
If you are dealing with information of a reasonable amount of volume, such as, information of registered members in your site, you'll need a database. But, there will be situations where you need to know how to work with text files and get use of them. I will provide some useful examples as we work through this tutorial.
Is working with a text file easier than working with a database?Working with text files is a very simple thing to do in PHP scripts. Database programming is also not a hard job. However, text files are a good starting place for novice programmers. In this tutorial I hope to teach you, how to:1. Open a text file.2. Write data into a text file.3. Close a text file.4. Read from a text file.5. Delete text files.7. Other functions regarding text files.8. An example & summarizing tutorial.9. Advanced examples:* Update selected rows in a text file* Deleting rows in a text file* Searching rows in a text file
Now let's go through the tutorial, step by step!
Next: Opening a text file >>
More Programming Basics Articles
More By Codewalkers