How to compare dates in PHP
How to actually compare 2 dates in PHP with each other? The question sounds easier than it is. The first thought that usually comes is the following. We store both dates as strings and compare them.
Preliminary
<?php
$date1 = "2012-1-12";
$date2 = "2011-10-12";
if ($date1 > $date2)
echo "$date1 is newer than $date2";
else
echo "$date1 is older than $date2";
?>
Output:
2012-1-12 is newer than 2011-10-12
At first glance this seems to be a workable solution. But what if the two data is in a different format?
<?php
$date1 = "12-1-12";
$date2 = "2011-10-12";
if ($date1 > $date2)
echo "$date1 is newer than $date2";
else
echo "$date1 is older than $date2";
?>
Output:
12-1-12 is older than 2011-10-12
Now the date in 2012 is declared to be older than the date in 2011, which is of course wrong. However, from PHP’s point of view, this behavior is correct, because two strings were compared […]
A few days ago I already described how to set up the Eclipse development environment for usage with Perl scripts. If you don’t want to use a sledgehammer to crack a nut, you can also use the Notepad++ editor to relatively comfortably write Perl scripts.

Nowadays you will hardly find a website without it. What is it what I’m taling about? Did you already guess it? I mean Like buttons, Share buttons, Like counter, avatars, etc. – if you look at today’s network landscape, it’s hard to imagine that there was a time before all that fancy stuff.
Today I want to present you one of my larger craft projects. This time it is not just about software, but also about the associated hardware. What is it? A web radio!