Jump to content

Year counter


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 post
Share on other sites
<?php$year =  date("Y");echo $year-1999;

Will this work?

Link to post
Share on other sites

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

Link to post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...