Category Archives: PHP

CodeIgniter Clippings for BBEdit

BBEdit is a powerful text editor, for Mac OS X, that provides nearly everything AF-Design needs to be effective when creating apps. While it’s not perfect, it works pretty well 99% of the time. It provides powerful tools for manipulating … Continue reading

Posted in : code, PHP, Software | Tagged : , , , | Comments Off on CodeIgniter Clippings for BBEdit

Accessing PHP Constants In Heredoc Strings and More

PHP’s built in heredoc string syntax is extremely valuable for creating blocks of HTML within a PHP file, however, it’s not currently possible to include a constant value within the block. There are a number of scenarios where you might … Continue reading

Posted in : PHP | Tagged : , , , , | Comments Off on Accessing PHP Constants In Heredoc Strings and More

Installing Facebook’s PHP SDK 101

Prerequisites: Familiarity with uploading PHP code, file includes and directory structures. If you are uncertain how to do any of these things, I recommend hiring someone to help you. Installing Facebook’s PHP SDK is really very simple, you have two … Continue reading

Posted in : Facebook Development, PHP, Web Hosting, Websites | Tagged : , , | 7 Comments

Reading the Twitter Stream API with PHP

Monitoring a term like ‘Facebook’ with the Twitter Search API can result in hundreds of tweets every minute. If you continuously issue requests for the next set of data, you’ll eventually get a message that reads, “You have been rate … Continue reading

Posted in : PHP | Tagged : , , | 18 Comments

PHP’s Eval() is Evil

A clients server was recently compromised because of a bug in an old software package that allowed writing to the filesystem. During the normal execution of the app, the code inserted itself into other files until nearly all .php files … Continue reading

Posted in : PHP, Security | Tagged : , | Comments Off on PHP’s Eval() is Evil

Validating Credit Card Numbers

The easiest way to pre-verify a credit card value is entered correctly is to use the Luhn algorithm to check for mistakes. This is commonly referred to as a mod-10, mod10 or mod 10 check. It’s always important when handling … Continue reading

Posted in : jQuery, PHP | Tagged : , , , | Comments Off on Validating Credit Card Numbers

Escaping Unicode Characters to HTML Entities in PHP

This is a severe hack I used to get around some character translation issues encountered with non-latin character sets. You should at all costs use a character set that supports international characters whenever possible, probably UTF-8 if your application language … Continue reading

Posted in : PHP | Tagged : , , , | 7 Comments

Working with Big Integers in PHP

This is the start of a class I developed for working with URL shortening and doing math with large numbers such as Facebook User Ids. There are some issues with the implementation of base convert, but if you are going … Continue reading

Posted in : PHP | Tagged : , | Comments Off on Working with Big Integers in PHP

Simple File Based Caching in PHP

Depending on the access pattern for the your data, file based caches are often more economical, despite being slower, than an in memory cache like Memcached or APC. Disk space is cheap and is therefore a good option for caching … Continue reading

Posted in : PHP | Tagged : , , , , , | 2 Comments

Zend Framework’s Podcast Reader Documentation

Using the Zend Framework can be incredibly frustrating due to the lack of clear documentation. Today I ran into an issue while trying to display an additional field from a RSS feed. The RSS feed is fairly simple, it was … Continue reading

Posted in : PHP | Tagged : , , , | Comments Off on Zend Framework’s Podcast Reader Documentation