Iteration over a time period in PHP

Repeatedly had to work with a list of dates on php (by days, for example) if there is a start and end of the period ($dateStart, $dateEnd). For example, to synchronize working/non-working days for the DatePicker from jQueryUi with the backend. Or if you need to display reports by days.

I suggest several options for solving this problem, both the most obvious way and a more elegant way (as it seemed to me).

Symfony Widgets Bundle

Widgets Bundle - a bundle for easy widgets management. (Supports only widgets which require only client-side code for displaying). Includes both client side (for displaying) and admin side (adds admin classes and has a SonataAdminBundle dependency) functionality.

Can be used (for example) for adding counters, banners, advertising network codes (google adsense, etc).

Was created during this blog has been developing.