What are the advantages and disadvantages of using text files as databases in PHP applications?

Using text files as databases in PHP applications can be advantageous due to their simplicity and ease of implementation. They are also portable and can be easily shared between different systems. However, text files may not be suitable for handling large amounts of data efficiently and may not provide the same level of security and functionality as traditional databases.

// Example of reading data from a text file in PHP
$file = 'data.txt';
$data = file_get_contents($file);
echo $data;