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.
PHP is a powerful open source server-sided scripting language that can be used on a wide variety of operating systems and webservers, including Apache on UNIX and IIS on Windows.
PHP contains numerous extensions which enable you to dynamically create images and flash files, parse xml, connect to remote servers using pop, imap, ftp, http and raw sockets, natively access many database servers including PostgreSql, MySQL and Microsoft SQL Server, compress and decompress files, lookup domain names and and much more.
PHP has an excellent manual and online documentation which covers every function for every extension available.
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.
Last week David Walsh posted about validating numeric values and digits with PHP on his excellent blog. I posted my own comments about his particular post but they never appeared so I decided to post a better response here.
Sometimes you need to be able to get the class name or parent class name of an object in PHP to do something conditionally etc. This post looks at how to do this.
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.
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.
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.