js
<script>document.write(new Date().getFullYear());</script>
PHP
<?php echo date("Y");?>
例:
<p class="copyright">Copyright © <script>document.write(new Date().getFullYear());</script> <a href="https://savalone.com">Savalone's Blog</a> All Rights Reserved.</p>
这样做好网站后就不用每年再去修改 foot 了
「本文由 Savalone 原创或搜集整理发布,转载请遵守 CC BY-NC-ND 4.0 许可!」