how is the best method create simply calendar?
i have for example in db:
id | date(unique)| text
1 | 2011-02-02 | aaa
2 | 2011-03-03 | bbb
3 | 2011-03-04 | ccc
..
10 | 2011-03-11 | dfg
for example now is 2011-03-04. i would like get from database -2 and +4 days: 02, 03, 04, 05, 06, 07, 08.
in php i make:
$now = strtotime("now"); and cut this substr(0, 10).
but how can i check -2 and +4 days. in this example this is simply, but what if it is 2011-11-30 and +4days this is new month. i would like make this automatically. it is possible?