2019-12-04 16:55:59 +01:00
|
|
|
<?php
|
|
|
|
function generateRandomString($length = 10) {
|
|
|
|
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
|
|
$charactersLength = strlen($characters);
|
|
|
|
$randomString = '';
|
|
|
|
for ($i = 0; $i < $length; $i++) {
|
|
|
|
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
|
|
|
}
|
|
|
|
return $randomString;
|
|
|
|
}
|
2019-12-07 22:16:05 +01:00
|
|
|
|
|
|
|
function checkHoursDifference($dateStart, $dateEnd) {
|
|
|
|
$dateStart = strtotime($dateStart);
|
|
|
|
$dateEnd = strtotime($dateEnd);
|
|
|
|
$diff = $dateEnd - $dateStart;
|
2019-12-16 15:49:25 +01:00
|
|
|
$hours = ($diff / (60*60));
|
2019-12-07 22:16:05 +01:00
|
|
|
return $hours;
|
|
|
|
}
|