How do I use PHP to get the current year?

后端 未结 26 2320
萌比男神i
萌比男神i 2020-12-04 04:31

I want to put a copyright notice in the footer of a web site, but I think it\'s incredibly tacky for the year to be outdated.

How would I make the year update automat

26条回答
  •  青春惊慌失措
    2020-12-04 05:06

    Just write:

    date("Y") // A full numeric representation of a year, 4 digits
              // Examples: 1999 or 2003
    

    Or:

    date("y"); // A two digit representation of a year     Examples: 99 or 03
    

    And 'echo' this value...

提交回复
热议问题