Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Setting the year dynamically

Featured Replies

Hi all

 

As you all know I'm no PHP expert, so I'm posting this thread to find out if it is possible to set the year dynamically using PHP.

 

In the footer of most of the sites that I create I have a copyright statement which states the year - all currently set to 2006. When 2007 comes along I'm going to have to go into all the sites and update that to 2007 and just wondered if there was a PHP script I could put in place of the year that would check what year it is and then display it to save me having to go in and do this manually.

 

E

I don't know about PHP but I do know in javascript you can.

  • Author

how do you do that then? and what happens if someone has javascript switched off?

  • 2 weeks later...
how do you do that then? and what happens if someone has javascript switched off?

 

Try this

 

<?php

 

echo "%Y";

 

?>

  • Author

mmm...

 

that just prints %Y on the page

  • Author

Ben you genius...thanks ever som much!

 

Dave was pretty close though...just changed what he suggested to:

 

<?php

echo date('Y');

?>

 

And it works!

 

Fab.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.