Jump to content

Year counter


vchris
 Share

Recommended Posts

I have something like this in my text: "It's been 8 years...". In a year it won't be 8 years it'll be 9 years. So I'd like to create a counter that will increase the years every year and I'm not sure how to do this in php.

Link to comment
Share on other sites

<?php$year =  date("Y");echo $year-1999;

Will this work?

Link to comment
Share on other sites

Isn't that the same as the code that I wrote? I mean in functionality?

Link to comment
Share on other sites

Doubtful, because smiles used "U" rather than "Y."
With "functionallity" you, in most cases, mean how "it function": The result, not the way to get the result.And nomather which you use the result will be same (number of years between 1999 and today).
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...