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

Help with lottery style system?
I'm working on a currency system for forums and it is going to have a type of lottery system built i

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

radio button reamains checked
Hello i'm trying to keep the state off my radio buttons so it shows which ones where clicked after t

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

Passing Arguments to execlp()
I'm writing a program that mimics a unix shell. It's supposed to take commands with arguments and ex

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

Generating unique numbers using php
Hi,
I need help in generating unique number using php.I tired using rand() in php.But, by using r

Email Processor
I have a few questions so this post will be a larger one! Sorry, but I'm a bit of a PHP newbie so be

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