Skip to content
Advertisement

PHP end a financial year in june of every year

I would like to do something of this sort in php, when the month reaches June 2016, I would like to echo 2016-17, but before that i echo 2015-16 What I have so far echos 2015-16 meaning it changes with the beginning of the year, but i would rather it does that in june onwards,

JavaScript

Any suggestions

Advertisement

Answer

Very basic but you can use it:

JavaScript

Explanation:

If current month is greater than 6 than it will print current year and +1 Year and hyphen (-) between them.

If current month less than 6 than it will print current year and -1 Year and hyphen (-) between them.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement