A couple of years back if you needed to run PHP on Google App Engine you were required to use a open source tool like Quercus, a 100% Java implementation of PHP, to run your PHP applications on the App Engine. However, as you would have guessed, it was not easy to work as with [...]
Most newbie (and some seasoned) programmers have difficultly constructing Regular Expressions. Many a times one needs to create a Regexp quickly to test a a particular piece of code. However, not being comfortable withe Regexps can be a problem. VerbalExpressions is a PHP library that enables you to construct regular expressions using natural language like [...]
One of my pet peeves regarding PHP is the terseness of the error messages it throws. Not that they are unhelpful; the major headache it that one has to open the source file at the given error location to check for problems. Also the complete system context (the PHP system variables, cookies, session etc.) is [...]
By default, Laravel is configured to create daily log files for your application, and are stored in app/storage/logs. All Laravel logging features are handled by the wonderful MonoLog library. Monolog includes various log handlers you can use – FirePHP, ChromePHP, CouchDB, Stream and many more. One of my favorites is FirePHP while debugging PHP apps.
Substring extraction of a long piece of text is a common element in web design, mostly in blogs and other CMS for displaying excerpts. The most common way to show an excerpt is to get n number of characters of the text, or n number of words. We will explore both ways. In PHP we [...]
Transferring files over FTP using PHP is easily done using various PHP functions and cURL. However transferring files over SFTP raises various problems and is not easily supported via PHP and cURL. phpseclib provides a nice library wrapper that enables easy access to the sftp protocol and various cryptography functions. phpseclib is designed to be [...]
Automatically extracting attachments from Gmail can be important for reasons where you need to process the attached files periodically with a CRON job. Also it can be useful for automatically archiving important attachments. Below is a simple proof-of-concept plain PHP code, devoid of any object-oriented features that extracts attachments from your Gmail account. It uses [...]
Although purists have always sneered upon PHP for being a “patched” language; the evolution of PHP over the years, with new features added in every version, has only increased its popularity. The latest 5.4 release has followed the trend with some major feature additions. The following post describes some important changes in PHP 5.4.
It seems that some common elements of programming stump us from time to time. Take the task of filtering a input search string in PHP to remove unwanted characters. Using a RegEx many developers find it easy to search for a substring, but find it difficult to use the same to reject some particular characters [...]