ScoRpion ScoRpion - 3 days ago 7
PHP Question

Get the number of days till today for the current month and current year

How To get the number of days that have already passed from the current month and the number of days that have already passed from the current year eg if today is April 6.
I should be getting 6 for current month and
I should be getting 97 for current year

Is there a way I can get the same excluding SUNDAYS

Answer

Take a look at the php date() function. It has a parameter 'z', which is the day of the year, in your situation 97:

echo date('z');

Same with day of the month:

echo date('j');
Comments