June 13th, 2006
How to Append Data to a Text File With PHP
A very good practice for any e-commerce or content syndication site is to build an email subscriber list. I recently had to whip together a quick way of doing this, and didn't have the time to build a database driven system. I used PHP and a text file to build an easy subscriber system. Each new email gets appended to the text file, simple as that.
Assume we have a text file called 'subscribers.txt', then here is the code. I use a function called checkEmail (explained on this site) to verify the authenticity of the email address.
