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

Cache PHP Objects/Classes?
Does anyone have ideas about caching PHP objects using something like: http://memcached.org/

background color imagefill
Hello

I would like to ask you why I see this square in red color just in my local xampp insta

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi

show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i

problem with php mysql query
Hi guy's...

I'm totally lost here..because don't have any idea how to make a query for grab r

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

Help with PHP Calendar code...
Hello, I'm new to this forum and I'm glad I found it.
I wrote this code for a PHP calendar as an

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