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

disable all input buttons
Hello Friends,

suppose i do have a file ( file.php ) has a submit button

Code: [Sele

Printing issues with xMII 11.5
For some reason, we have one report (and only one) that is giving us fits when trying to print. The

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

Multiple WHILE loops help
Hi there. I'm writing an application that is pulling and displaying results for real estate listing

PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

using file_get_contents??
okay how would i create a script using file_get_contents() in php have it grab search pages 1-20 and

Rand() help needed
Hi all,

Can someone explain and give me a quick example of how I would go about this?

paginate search result
Hi, I have a paginations script to display data from my database but i would like to paginate someon

Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th

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