Home / Widgets / Replace [year] with the current year
Duplicate Snippet

Embed Snippet on Your Site

Replace [year] with the current year

Type [year] anywhere that you want the current year to be inserted.

Code Preview
php
<?php
// This will replace "[year]" with the current year automatically.
$this_year = "[year]";
echo str_replace("[year]", date( 'Y' ), $this_year);

Comments

Add a Comment