Five Cool PHP Array Functions
Wednesday, October 21st, 2009Time and time again, I come across code that contains a variety of array-handling functions that too often duplicate the work that the PHP core team has done to develop built-in array functions. Since the built-in functions are inherently faster, trying to reimplement them in PHP will inevitably be a performance problem. Here are five [...]
1:00 am | Comment (21) | Print | Categories: Best Practices, General PHPHow To Write A Function In PHP
Monday, October 12th, 2009PHP allows developers to write a variety of different styles of code: procedural, object-oriented, or simply scripts. This flexibility makes PHP easy to learn, and also means that new developers to PHP may not be programmers in other languages.
1:00 am | Comment (11) | Print | Categories: General PHPConfiguring PHP: Essential INI Settings
Monday, September 28th, 2009When setting up a web server with PHP, there are a number of settings that are critical to consider. PHP 5.3 contains both a development INI file and a production INI file; however, users of older PHP releases (or those who don’t have direct control over their INI files) will want to pay attention and [...]
1:00 am | Comment (16) | Print | Categories: Best Practices, General PHP, PHP 5Avoiding Notices: When to Use isset() and empty()
Wednesday, September 23rd, 2009One of the most confusing things for new programmers (and it even trips me up sometimes) is how to test for boolean conditions in code. As developers, we want to develop code that never emits notices or warnings, and PHP gets a bit antsy when we develop code that utilizes uninitialized variables. Lucky for us, [...]
1:00 am | Comment (13) | Print | Categories: Best Practices, General PHPSearching Arrays for Values
Monday, December 22nd, 2008Sometimes I have to check an array for the existence of a value; for example, I may want to parse an array for a value and then include (or exclude) that value fro an SQL query. I quickly found out that using in_array() is slower than using isset(). For example:
6:56 pm | Comment (3) | Print | Categories: General PHP, PHP 5
Web developer, amateur photographer, lover of the outdoors and travel. Expect to find me writing code, hiking or visiting new places. I own Blueprint DC and live in Washington, DC. Follow Me On Twitter!- July Slides
- Some Thoughts On Software Licensing
- Interfaces Make Testing Easier
- Revisiting: Why Every Developer Should Write Their Own Framework
- The Fallacy of Sunk Cost
- PHP: The Good Parts – Book Review
- 1st Amendment, Meet 4th Amendment: The Gizmodo Search Warrant
- A Closer Look At ArrayObject
- TEK Webcast Notes
- Caching For WordPress – A TEK-X Webinar
