âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Flat File Text Database System Display Content

Published : November 22, 2014   •   Last Edited : November 24, 2025   •   Author : Adam Khoury
In this 2 part video series we demonstrate using .txt flat file database systems as an alternative to MySQL, XML, or other database systems. In this part 1 you will learn 2 methods for displaying and accessing external text files within your PHP scripts.
<?php
if (file_exists("file1.txt")) {
    // Method 1 for displaying external text file data
    // include_once "file1.txt"; // Uncomment this line to use
    // Method 2 for displaying external text file data(preferred)
    $myData = file_get_contents("file1.txt");
}
echo $myData;
?>