tomyknoker
05-06-2007, 11:33 AM
Can someone explain why this is happening... here is part of the code...
$date = date('d/m/Y');
$p = explode ( ' ', date('m Y') );
if ($p[0] == 1) {
$Month = 12;
$theYear = $p[1]-1;
}
else {
$Month = $p[0]-1;
$theYear = $p[1];
}
if ($Month < 10) {
$theMonth = '0'.$Month;
}
else {
$theMonth = $Month;
}
$monthText = date("F", mktime(0,0,0,$theMonth+1,0,0));
Basically from this I am pulling info out of my database about my members, this one pulls information of them logging from last month... It works fine, but I added in the query so it says 'These members logged in $monthText'... When I ran it it was saying 'March' so I had to add the +1 after $theMonth, just not sure why I need to add the +1, any ideas?
$date = date('d/m/Y');
$p = explode ( ' ', date('m Y') );
if ($p[0] == 1) {
$Month = 12;
$theYear = $p[1]-1;
}
else {
$Month = $p[0]-1;
$theYear = $p[1];
}
if ($Month < 10) {
$theMonth = '0'.$Month;
}
else {
$theMonth = $Month;
}
$monthText = date("F", mktime(0,0,0,$theMonth+1,0,0));
Basically from this I am pulling info out of my database about my members, this one pulls information of them logging from last month... It works fine, but I added in the query so it says 'These members logged in $monthText'... When I ran it it was saying 'March' so I had to add the +1 after $theMonth, just not sure why I need to add the +1, any ideas?