Jump to content

saaima

New Members
  • Posts

    5
  • Joined

  • Last visited

saaima's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. I have been trying my best, and needed extra help - I thought this is what forums are for, when you have no one else to ask for help. It wasn’t intended to be malicious or abusive and warning was completely uncalled for.
  2. Thank you for your help. I am taking fast track web development classes, and this was one of the homework tasks - I gave my tutor all three previous answers, which still return the correct outcome, but he insisted it must be done with a function and parameter.
  3. Hi there, no, it's just for training purposes, to make dates change automatically as time passes.
  4. Hi, I should have posted what I have so far. So I had three versions of solving this, they are below: <?= '&copy 2015 -' . date("Y");?> <?php function auto_copyright($year = 'auto'){ if(intval($year) == 'auto'){ $year = date('Y'); } if(intval($year) < date('Y')){ echo '&copy ' . intval($year) . ' - ' . date('Y'); } if(intval($year) > date('Y')){ echo '&copy ' . date('Y'); } } auto_copyright(); auto_copyright('2016'); ?> <?php $startDate = 2015; $currentDate = date('Y'); echo '&copy ' . $startDate . (($startDate != $currentDate) ? '-' . $currentDate : ''); ?> What I am looking for is another way to solve this, particularly involving function. Cheers
  5. Hi there, can someone help to write a code for Copyright tag at the footer of the page. The format needs to be webpage start year - current year (eg © 2015-2020 ). I need to use function and parameters. The code should be as simple as possible as i am just a beginer! Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.