which function used to get the number of days between two
given dates in php

Answer Posted / silambu_irtt

<?php
$days = (strtotime("2005-11-26") - strtotime("2005-11-20"))
/ (60 * 60 * 24);
print $days;
?>
This code print number of days between two dates

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are differences between PECL and PEAR?

518


What is a controller php?

509


What are the functions for imap?

597


Tell me what does pear stands for?

558


How do I escape data before storing it in the database?

577






Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.

1513


What is php default argument?

543


What are escaping characters?

545


Can you define an argument as a reference type?

558


How do I escape in php?

552


Tell me how would you declare a function that receives one parameter name hello?

542


What is the use of strpos in php?

563


What new features php7 has in store for us?

570


What PHP stands for?

572


What are interfaces in php?

523