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 mvc in php?
How we can get the number of elements in an array?
what are the rules to be followed at the time of declaring a variable?,what is the purpose of var_dump()function in php,syntax of ternary operator()in php,difference between drop a table and truncate a table...
how can i find number of rows in a table using MS Access and php? i used odbc_num_rows($query); but it returned -1.
What is a php web application?
How can you get web browser’s details using PHP?
Why session is required?
Maine 12th ke bad 2 years ka web designing ka course kiya hai. Php me achcha hu. Ek fresher ko is field me kitna mil sakta hai ?
Is key in array php?
What is the diffrence between GET,POST and REQUEST Method.
What is mysqli_query?
What is the use of friend function?