You've stumbled across the archive of the blog posts I wrote back in 2014 and prior. Feel free to peruse, through everything from code snippets that never made it to GitHub, to random ramblings about my passion for technology.

As a coder who picked up on Java and JavaScript string concatenation ("text" + var + "more text"), in PHP I always used "text" . $var . "more text". That may change soon, though, as it seems that embedding variables in string literals is a bit faster.

Continue reading...

A substitute for str_ireplace() which I wrote to allow its usage on PHP versions below 5.

Continue reading...

Since file_put_contents() is not included in PHP 4, I wrote a function to allow its use for anyone still on legacy versions.

Continue reading...

In PHP, when you submit a file input that has multiple files (as in, it is named <input ... name='foo[]' />), it organizes it oddly. The $_FILES array contains a single key, then within that key is an array with keys "name", "tmp_name", "size", "type", "error". Within each of those keys is an array with the data for each file.

Why?

Continue reading...

Just like jQuery's extend, this code will allow you to replace existing values of an array with new values, based solely on matching keys.

Continue reading...