php get day diff
$now = time(); // or your date as well
$your_date = strtotime("2010-01-31");
$datediff = $now - $your_date;
echo round($datediff / (60 * 60 * 24));
php get day diff
$now = time(); // or your date as well
$your_date = strtotime("2010-01-31");
$datediff = $now - $your_date;
echo round($datediff / (60 * 60 * 24));
array_diff php
<?php
$arr_1 = array("a" => "car", "b" => "plane", "c" => "boat", "d" => "bike");
$arr_2 = array("e" => "car", "f" => "plane", "g" => "boat");
$result = array_diff($arr_1, $arr_2);
print_r($result);
/* Result:
Array
(
[d] => bike
)
*/
php difference between two dates
$date1 = "2007-03-24";
$date2 = "2009-06-26";
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
printf("%d years, %d months, %d days\n", $years, $months, $days);
php array_diff
PHP function array_diff(array $array1, array $array2, array ...$_) int[]
--------------------------------------------------------------------
Computes the difference of arrays.
Parameters:
array--$array1--The array to compare from
array--$array2--An array to compare against
array--...$_--[optional]
Returns: an array containing all the entries from array1 that are not present in any of the other arrays.
whats the difference between using date function and DATETime in php
function weeknumber($ddate) {
$date = new DateTime($ddate);
return $date->format('W');
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us