How to calculate days from variable date?


Posted on 16th Feb 2014 07:03 pm by admin

This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:

Code: <?php
$mydate = "";
Did you know?Explore Trending and Topic pages for more stories like this.
$daysaway = 400;
$startdate = "5/5/2005";

//I need how to get the date that was 400 days ago

print "$mydate was $daysaway days from $startdate.";
?>
No comments posted yet

Your Answer:

Login to answer
223 Like 50 Dislike
Previous forums Next forums
Other forums

Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down me

Load Animated Image while cache is serve
I have a page that loads up using cache and took about 1 to 2 minutes before it loads to the page. <

Redistributing dependent dlls
Hai all ,

I have created an application in VC++ using VS2008 in a development machine which r

php email checker
I am having alot of trouble finding info on how to do these email things. I need to do the following

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

limit string by words??
hello all,

I was wonder if there is a function to limit a string by the number of words inste

reating a background image
I am building a site in drupal and have a php form in it, due to certain annoyances with module buil

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on

Passing Variables
What I'm wanting to do is when the user clicks on Arenas it will know the name of the country it's w

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash