Jump to content


Photo

dynamic sig help


  • Please log in to reply
3 replies to this topic

#1 icydude

icydude
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 03 March 2006 - 10:00 AM

I have been searching everywhere but i cant find a helpful artical for my needs.

I need to create a counter that outputs a 25x25 png with a single number and white back ground.

It would begin on Feb 25, 2006 then count up by one daily.
so today it would be 6, then tomorrow display 7 then 8 and so on.


can anyone help me out?


#2 icydude

icydude
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 03 March 2006 - 09:15 PM

well i figured it out a bit.

now my question is how do i get my output to be absolute value with no "-" sign.

<?php

$days = (strtotime("2006-2-25") - strtotime(date("Y-m-d"))) / (60 * 60 * 24);
print $days;

?>


#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 March 2006 - 10:23 PM

echo abs($days);

Legend has it that reading the manual never killed anyone.
My site

#4 exeterdad

exeterdad
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 March 2006 - 10:35 PM

Maybe not the shortest way.... but works for me.

<?php

$days = floor((strtotime("now") - strtotime("2006-2-25")) / 86400);
print $days;

?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users