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

How to form a xml form table with a single sql statement..?
Hi everyone,
I don't know if this is going to be a duplicate thread but i couldn't

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

PHP page loading in Firefox but not in IE
hello,

i am currently doing a project in PHP and i have a problem. If I view the project in M

LIMIT $start, 10... how to pass last value queried into next page with GET??
Ok I know how to display the first or last 10 results of a query...

$result = mysql_query(&q

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

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

help with insert
Hi there,

I am trying to insert some data into a database, but for some reason, it is not ins

Loops and Classes
I am making a template system and everything seems to be going well up until I have to loop in a var

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

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