Method chaining with PHP

Having used the Zend Framework on a couple of projects and spent a lot of time reading the documentation I discovered the use of method chaining. This post looks at how to use method chaining in PHP.

Categories PHP

Open a mailbox other than the INBOX with PHP IMAP

This post is part of an on-going series on this blog about connecting to IMAP mailboxes with PHP, ultimately showing how to download and parse reports from Google Analytics. When logging into an IMAP server with PHP the default mailbox is used – usually the INBOX. This post looks at how to list the mailboxes for the IMAP account and then how to connect to one of the other mailboxes.

Categories PHP

How to use PHP’s __autoload function

PHP introduced the __autoload() function in version 5 which is called whenever the code tries to use a class that has not yet been defined. You simply put some code into __autoload() to include the appropriate class file and don’t have to bother about manually including those files. This post looks at how to do this with examples.

Categories PHP

Using hash algorithms in PHP

PHP has a number of hashing algorithms available for creating hash values of files and strings. A hash is a non-reversible fixed length string which has a number of applications, such as storing a password in a database in a way that can not be read. This post looks at how to show the available hashes in PHP and how to use the hash() function to generate a hash value.

Categories PHP