Tutorial

Read a line

Read a text file function is important for text-based programming. Company profile is a good example to start.
The profile consists of the company information needed by the documents across the board. Documents like invoices, purchase orders, and more.
However, some webpage only need on piece of the information from the company profile like accounting month. In this case, read a specific line is better rather read the whole company profile. This will keep the programming short.

Webpage generated from the code.

Profile text file.

In text-base database, every text file is a record or data. In the record, the sequence of the text in the lines are the database structure how the program read the file. In this example. the very first line is the company name. All subsequence program has to follow the structure to read the file.

Functions used in this webpage:

PHP

PHP file() Function
PHP count() Function
PHP echo() Function

Coding area: