How do I use PHP to get the current year?

后端 未结 26 2319
萌比男神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 04:58

    use a PHP function which is just called date().

    It takes the current date and then you provide a format to it

    and the format is just going to be Y. Capital Y is going to be a four digit year.

    
    

提交回复
热议问题