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

jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are

Delete all from a table
I can not get the following code to work. If I run the sql statement in the db it will delete all t

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

update sql when refresh - php
hi
I have made a table (attachement)

the users can update the sql database using + or x bu

phpMailer will not connect using SMTP
I am trying to use phpMailer with smtp:

Code: [Select]$mailer = new PHPMailer();
$mailer-&

PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the passw

Query output more than expected
$query=mysql_query("SELECT * FROM players, communities, divisions WHERE dob BETWEEN '{$start_da

Help with form post data and arrays
Hi all,

I am new to this forum... It has been awhile since i have worked with arrays, and i a

$GPRMC and NMEA how to extract from report
Hi There,

Im a little bi lost and not sure where to start with this one, ive got a small gps

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