I thought I would share this function with the PHP community, as it seems to be working pretty well. I created it as part of a page for creating screensaver images for the Amazon Kindle. It accepts the path to a JPEG image file and the desired width and height, then returns a PHP image [...]
Expressing the Difference Between 2 Dates/Times
In an effort to consolidate some things I’ve posted on my site in a less organized manner, here is a reprint of a function I came up with a few years ago for expressing the difference between two UNIX timestamp values (such as returned from the time() and mktime() functions). The result is an array [...]
Undoing Magic Quotes
The often maligned (and rightfully so) magic_quotes_gpc “feature” of PHP can be problematic, especially if you are trying to develop scripts for general consumption on any platform. A brief example of the sort of problem it can cause is that if it is turned on and you do not undo its addition of back-slash escape [...]
Book Review: CodeIgniter 1.7 Professional Development
I was recently provided a review copy of CodeIgniter 1.7 Professional Development by Adam Griffith (Packt Publishing). It claims that it will help the reader “Become a CodeIgniter expert with professional tools, techniques and extended libraries.” As someone who has used CodeIgniter and found it to be very useful, I was looking forward to [...]
Object Iteration in PHP 5
PHP 5 gives us the ability to iterate through objects much as we can with arrays, such as with the foreach() loop construct. I knew this ability existed but had not really looked into it or made use of it. However as a result of a thread at PHPBuilder.com, I thought this might be a [...]
Good News / Bad News
The good news: PHP has lots and lots of useful built-in functions for all sorts of things.
The bad news: PHP has lots and lots of useful built-in functions I don’t know about.
Sometimes it’s almost an embarrassment of riches. You think you know PHP pretty well and know how to write some pretty slick code. In [...]
Beginners’ Corner: Variable Function Parameters
Sometimes when defining a function in PHP, you find that there may be cases where you do not want to specify all the possible parameters when calling it. This could be because you want it to use a default value, or that in certain cases it does not logically apply. If you find yourself in [...]
