How to get current year in PHP?

How do I get the current year using PHP? I want to update the footer copyright year automatically. This is not a good idea to put a fixed year on the website.

If you are looking for the copyright year in the footer. You can do it in both PHP and JavaScript.

PHP

<?php echo date("Y"); ?>

Laravel

{{ now()->year }}
// Or
{{ date("Y") }}

JavaScript

<script>document.write(new Date().getFullYear())</script>