3
Good afternoon to you all! I did some research before asking the question, but I did not get an answer to my question in any of them.
I need help in getting the following code to receive both dates for the $_GET variable, example (.php?data1=23-09-16&data2=20-09-16). Basically display the dates entered in full and show the difference of days between them.
I did a functional exercise, which is the best way to adapt it to receive the dates from abroad?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>teste dias</title>
</head>
<body>
<?php
$br="<br>";
$agora=mktime(17,00,00,9,23,2016);
$agora=date("F d, Y - g:i:s a", $agora);
echo "Hoje e agora são: ".$agora.$br;
$dia1=mktime(0,0,0,1,1,2016);
$dia2=mktime(0,0,0,2,1,2016);
echo (($dia2-$dia1)/60/60/24)." dias".$br;
echo $br;
?>
</body>
</html>
Thank you!
Related How to calculate the difference between two dates?
– Wallace Maxters