write code to find the date difference b/w two given date
using PHP not MYSQL function?
Answers were Sorted based on User's Feedback
Answer / vipul dalwala
$noofdays = ceil(((strtotime($endDate) - strtotime
($startDate)) / (60*60*24)))
| Is This Answer Correct ? | 13 Yes | 2 No |
Answer / rajan
$a= gregoriantojd(1,30,2009);
$b= gregoriantojd(1,5,2009);
echo $a-$b;
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / rameshfromind
There is one function for gregoriantojd that means convert
to gregorian calendar date to julian date count.
Below the example for counting days between two date.
<?
$startDate = '01-01-2008' // mm-dd-yyyy/yy
$endDate = '01-30-2008' // mm-dd-yyyy/yy
echo gregoriantojd($endDate) - $gregoriantojd($startDate);
?
// OUTPUT
29
| Is This Answer Correct ? | 9 Yes | 9 No |
What is the difference between echo print and print_r in php?
where do we use htaccess?
How to Retrieve video files in php from database.....and how to store video on database..
What is meant by ‘passing the variable by value and reference' in php?
Explain me what is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?
Is python easier than php?
What is fetch array in php?
What are the popular frameworks in php?
List out different arguments in PHP header function?
Which software is used to run php programs?
How do you destroy a session?
Explain about switch statement in PHP?