And that's about all I have. Over the course of the last few pages, I took you ever deeper into the waters of PHP's filesystem API, demonstrating a number of its more arcane features and functions. I showed you how to strip out program code from a file while reading it, how to parse comma-separated data from a file into PHP structures, and how to read configuration variables into a PHP associative array. Next, I introduced you to PHP's file copy, move and delete functions, and demonstrated them in the context of a file upload application. I also showed you how to read and display the contents of a directory, and how to recursively iterate through a series of nested directories. Finally, I wrapped things up with a brief look at how to obtain disk usage reports for a mount point or partition, and explained how you could read data from processes just as you do with files. While this tutorial did cover many of the common uses of PHP's file and directory manipulation functions, it is by no means exhaustive. There are many more things you can do with PHP's file functions - and you can get some great ideas (and learn a number of interesting things as well) by perusing the PHP manual pages for these functions, at the links below: PHP's file manipulation functions, at http://www.php.net/manual/en/ref.filesystem.php PHP's directory manipulation functions, at http://www.php.net/manual/en/ref.dir.php And while you busy yourself with those links, I'm off on a short break. See you soon! Note: Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!
blog comments powered by Disqus |