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

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [

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

help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "

Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything

Specific name typed, specific image shown on html page
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

contact form - output to page and email
I have the following in my controller:

$message['name'] = htmlentities(strip_tags(trim($_POST

Multi dimensional arrays
If I put in this code:

1
2
3
4
5
6
7
8
9
10
11
12
13<

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