Dynamic PHP Copyright Date Code

Pretty simple but pretty handy too! Here's a short tutorial to generate the current year in your footer's copyright declaration. It also detects if the the site has been running for less than a year to avoid the date printing out like this © 2011-2014 rather than just this © 2011.

Example: Arastiriyorum © 2010-2014 All Rights Reserved.

Both of these methods work the same way.

Pure PHP
echo "Arastiriyorum &copy ";
$start_year = 2010; //change to the year you launched your website
echo (date('Y') == $start_year) ? $start_year : $start_year . "-" . date('Y');
echo " All Rights Reserved.
";
Mixed HTML & PHP
Arastiriyorum ©
  $start_year = 2010; //change to the year you launched your website
  echo (date('Y') == $start_year) ? $start_year : $start_year . "-" . date('Y');
?>
All Rights Reserved.
If you're looking to add the trademark symbol (™) or any others check out CopyPasteCharacter.com

Yorumlar

Bu blogdaki popüler yayınlar

Uzak Masaüstü Bağlantı Geçmişini Silmek

TERMINAL SERVICES UNLIMITED

Gpupdate Komutu