Login
Register
Questions
Unanswered
Tags
Users
Ask a Question
Welcome to phpanswers , where you can ask questions and receive answers from other members of the community.
How can we know the number of days between two given dates using PHP?
0
votes
interview
php
asked
2 years
ago
by
Neeraj Narkhede
(
1,670
points)
2 Answers
0
votes
PHP dont provide any specific function like MySQL. If you are compairing the dates with database then It's recommendated that use the DATEDIFF() function from MySQL cos it's more efficient cos it will give u the diff directly you dont have to process the output for date difference.
answered
2 years
ago
by
vikramapte
(
1,980
points)
0
votes
(strtotime($date1) - strtotime($date2)) / (60 * 60 * 24);
answered
9 months
ago
by
anonymous
Related questions
0
votes
1
answer
How can we know the number of days between two given dates using MySQL?
asked
2 years
ago
by
Neeraj Narkhede
(
1,670
points)
interview
mysql
0
votes
3
answers
How can we find the number of rows in a result set using PHP?
asked
2 years
ago
by
Neeraj Narkhede
(
1,670
points)
interview
mysql
php
0
votes
2
answers
How can we know the count/number of elements of an array?
asked
2 years
ago
by
phpanswers
(
1,125
points)
interview
php
0
votes
2
answers
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
asked
2 years
ago
by
phpanswers
(
1,125
points)
interview
php
0
votes
1
answer
How can we get the properties (size, type, width, height) of an image using PHP image functions?
asked
2 years
ago
by
phpanswers
(
1,125
points)
interview
php