<?php
$text = file_get_contents("https://vk.com/foaf.php?id=1488");
preg_match('|ya:created dc:date="(.*?)"|si', $text, $arr);
$time_create = strtotime($arr[1]);
$time_current = time();
$check_time = 5/*дн.*/*86400; //5 полных суток
echo "Created: ".date("d-m-Y H:i:s", $time_create)."\n";
echo "Compare date: ".date("d-m-Y H:i:s", $time_current)."\n";
if(abs($time_current-$time_create) >= $check_time)
{
echo "С момента регистрации прошло больше 5 дн."."\n";
}
else
{
echo "С момента регистрации прошло меньше 5 дн."."\n";
}
Created: 02-12-2006 13:10:20
Compare date: 03-03-2020 22:49:32
С момента регистрации прошло больше 5 дн.
@receiver(post_save, sender=FingerPrint)
def update_calculated_fields(sender, instance, **kwargs):
tlsh = instance.calculate_tlsh()
sender.objects.filter(pk=instance.pk).update(tlsh=tlsh)
declare(strict_types=1);
/**
* @param int|string|float $a
* @param int|string|float $b
* @return string
*/
function summ($a, $b): string {
return bcadd((string)$a, (string)$b);
}
declare(strict_types=1);
function summ(int|float|string $a, int|float|string $b): string {
return bcadd((string)$a, (string)$b);
}
return $result > \PHP_INT_MAX ? $result : (int)$result;
def loop(n):
for i in range(n):
print('Privet')
much = int(input('how much? '))
loop(much)
more = str(input('Еще? '))
if more == 'yes':
loop(much)
range()
, а лучше обойтись переменной, которую уменьшать от much
к 0:much = int(input('how much? '))
i = much
while i > 0:
print('Privet')
i = i - 1
if i == 0:
more = str(input('Еще? '))
if more == 'yes':
i = much