I need to count the number of times a certain day exists in a month, so how many mondays in this month etc
Tried this but didnt count correctly, kept saying there were 5 tuesday this monday when there are only 4.
if (($dow = date('w', $now)) == $row['day_of_the_week']) $dow = 7;
$begin = $now - (86400 * ($dow));
echo "x ".ceil(date('d', $begin) / 7); ?>