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



write code to find the date difference b/w two given date using PHP not MYSQL function?..

Answer / vipul dalwala

$noofdays = ceil(((strtotime($endDate) - strtotime
($startDate)) / (60*60*24)))

Is This Answer Correct ?    13 Yes 2 No

write code to find the date difference b/w two given date using PHP not MYSQL function?..

Answer / rajan

$a= gregoriantojd(1,30,2009);
$b= gregoriantojd(1,5,2009);
echo $a-$b;

Is This Answer Correct ?    6 Yes 1 No

write code to find the date difference b/w two given date using PHP not MYSQL function?..

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

Post New Answer

More PHP Interview Questions

Explain Whitespace Characters?

0 Answers  


Write down the benefits of php7?

0 Answers  


Tell me how to find current date and time?

0 Answers  


What is split function in php?

0 Answers  


How can we display the output directly to the browser?

0 Answers  






What is php crud api?

0 Answers  


What is the difference between php and cakephp?

0 Answers  


Which method do you follow to get a record from a million records? (Searching not from database, from an array in php)?

0 Answers  


How can we encrpt a text?

3 Answers  


How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using regular expression of PHP?

6 Answers  


How to redirect a url from http to https in .htaccess?

0 Answers  


i have saved the password in encrypted format in database. now i want how to retrive the password in decrypted format.

6 Answers  


Categories