Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevArticles:
Talking FTP with PHP
Feb 24, 2003 @ 13:16:30

If you've ever wanted to use PHP as an interface to an FTP server, but never quite understood the documentation or just never could get it to work quite right, this new article from DevArticles might just help you out.

In one of their latest, My FTP Wrapper Class for PHP, one of the founders of the site explains how he took the standard PHP functionality (the FTP functions it has built in), and wrap them up in a "wrapper class" that allows for a bit easier use of this functionality. This class allows you to do things like: check for a connection, save to a remote file, create remote directories, rename files, and even check to see if a remote file exists. It's a quite complete interface for interacting with a remote FTP server, and can really make your code much more efficient to work with.

Layers of abstraction like this are great, especially if the PHP functionality is difficult to use anyway, but you have to watch out that you're not abstracting things out like crazy, making 20 different classes just to do one thing. You don't need a display class, a text formatting class, and a input class just to echo out "Hello World"....

tagged:

Link:


Trending Topics: