PHP Solutions

Chapter 7

The theme of this chapter is managing files.

Solution Index

PHP Solutions 7-1
Reading a text file into a string
Using a separate PHP file to display the contents of a .TXT document.
PHP Solutions 7-2
Reading a text file into an array
And splitting the subsequent array into an associative array.
Reading a file with fopen()
Reading a .TXT file by looping through each line and adding <br /> at the end of every pass.
Replacing content with fopen()
PHP Solutions 7-3
Using the buildFileList() function
Building an drop-down menu from reading the contents of a folder.
PHP Solutions 7-4
Using the getNextFilename() function
Creating .TXT files from a comments box and saving them to the server.
PHP Solutions 7-5
Opening a news feed with fsockopen()
What you get is dependant on the browser and your RSS settings. Firefox asks if I want it on my Google Reader, IE displays a recent list of updated articles.
PHP Solutions 7-6
Prompting a user to download an image
Instead of linking to it for viewing.