Well for one, this doesn't make much sense:
$startDate = date('2012-01-01');
$endDate = date('2012-01-31');
You might as well have written:
$startDate ='2012-01-01';
$endDate = '2012-01-31';
since you aren't actually using date() in any way.
Next, note that PHP isn't as intelligent as MySQL is when it comes to inequalities involving dates, mostly because PHP isn't aware of the difference between a date string (like '2012-01-01') and the string "Watermelons are really tasty!"... mostly because there really is no difference at some level; they're both just strings, after all.
As such, this comparison:
$currentDate < $endDate
would appear to be comparing two strings initially (and, after the first iteration, one number and one string) numerically, which doesn't make much sense. (Is "Watermelons are really tasty!" greater than, less than, or equal to "Hello world." ?)
In the end, I would suggest going about this a different way; take a look at PHP's [man]DateTime[/man], [man]DateInterval[/man], and [man]DatePeriod[/man] classes. The basic process would be something like:
Create two instances of the [man]DateTime[/man] class - one each for the starting and ending dates.
Create an instance of the [man]DateInterval[/man] class to describe the desired interval between dates (e.g. 1 day).
Create an instance of the [man]DatePeriod[/man] class, supplying the above objects as described in the class' constructor (see: [man]DatePeriod.construct[/man]).
"Traverse" (fancy word for what we commonly use the phrase "loop through", i.e. "loop through the array with a foreach() loop") the object, e.g. using a [man]foreach[/man] loop, and output each [man]DateTime[/man] object returned in each iteration.
The first (and, presently, only) user comment on the [man]DatePeriod.construct[/man] man page pretty much illustrates this usage of the DatePeriod class, so you could heavily rely on that as an example of what you're trying to do.