Remembering syntax patterns through context

Speaking of array functions in PHP, ExpressionEngine developer Derek Jones shares a trick for remembering which order to send your arguments in when using various php search functions. All array-related functions use needle, haystack and all string-related functions use haystack, needle. There are certain words in the english language which no matter how many times [...]

Brevity and Readability

So I’m cruising along in Ruby one day, when all at once I realize I’ve stopped writing. I’m stuck. I needed to compare two arrays, and trim one so that any records in it would be removed if they existed in the other one. In PHP, one way to do this would be to loop [...]

Recursive (multidimensional) array search in PHP

If you are looking to do a recursive array search in PHP (and don’t feel like writing your own), you might have tried a number of the functions described in the comments section of the array_search page in the manual. Just for future reference, I have tried a few, but not all of them worked [...]