$kbd = [];
foreach($ds->children() as $dt) {
$kbd[] = [
'text' => $dt->title,
'callback_data' => $dt->id
];
}
$keyboard = [
'inline_keyboard' => [$kbd]
];
$buttons = json_encode($keyboard, true);
<?php
session_start();
require_once "connect.php";
$stmt = mysqli_prepare($connect, "SELECT `Password` FROM `users` WHERE `Email` = ?");
mysqli_stmt_bind_param('s', $_POST['Email']);
mysqli_stmt_bind_result($hash);
mysqli_stmt_execute($stmt);
if (mysqli_stmt_fetch($stmt) && password_verify($_POST['password'], $hash)) {
echo 'Logged';
}
}
function getFreeInterval($intervals, $startTime, $endTime)
{
$result = [];
$ok = false;
foreach($intervals as $key => $interval){
list($start, $end) = explode('-', $interval);
if ($startTime >= $start && $endTime <= $end) {
$ok = true;
if ($startTime > $start) {
$result[] = "{$start}-{$startTime}";
}
if ($endTime < $end) {
$result[] = "{$endTime}-{$end}";
}
} else {
$result[] = $interval;
}
}
return [
$ok,
$result
];
}
$intervals = [
'09:30:00-13:15:00',
'14:00:00-17:00:00'
];
list($ok, $result) = getFreeInterval($intervals, '09:30:00', '10:15:00');
var_dump($ok, $result);
// bool(true)
// array(2) {
// [0]=> string(17) "10:15:00-13:15:00"
// [1]=> string(17) "14:00:00-17:00:00"
// }
"CREATE TABLE {$game_name} (
game_id INT(11) DEFAULT {$output['id']},
...
Required parameter $limit follows optional parameter $slug
$schedule = [
'weekdays' => [
1 => [[0, 24]],
2 => [[0, 24]],
...
7 => [[0, 6], [8, 24]]
],
'dates' => [
'2020-12-31' => [[0, 6], [8, 17]],
'2021-01-01' => [[0, 0]],
'2020-01-02' => [[10, 23]],
...
]
];
function isWorkTime($schedule) {
$date = date('Y-m-d');
$weekday = intval(date('N'));
$hour = intval(date('H'));
$daySchedule = $schedule['weekdays'][$weekday];
if (array_key_exists($date, $schedule['dates']]) {
$daySchedule = $schedule['dates'][$date];
}
foreach ($daySchedule as $workTime) {
if ($hour >= $workTime[0] && $hour < $workTime[1]) {
return true;
}
}
return false;
}
$inputNumbers = [3279, 920, 4181, 8, 1, 4360, 407, 9950, 2098, 8579, 4914, 7204, 8875];
$max = max($inputNumbers);
$fib = [];
$f1 = 0;
$f2 = 1;
do {
$fN = $f1 + $f2;
$f1 = $f2;
$f2 = $fN;
$fib[] = $fN;
} while ($fN < $max);
$sum = array_sum(array_intersect($inputNumbers, $fib));
print $sum;