$isNotOverlapped = $range2start > $range1end || $range1start > $range2end;
$isOverlapped = !($range2start > $range1end || $range1start > $range2end);
$isOverlapped = $range2start <= $range1end && $range1start <= $range2end;
typeof arg === 'string'
// ещё можно длину проверить, а то, вдруг длинное пришлют
arg.length === 1
arg.toLowerCase() !== arg.toUpperCase()
// строка перевелась в разные кейсы
arg.toUpperCase() === arg // значит, буква в верхнем регистре
"packages": [
{
"count": 1,
"dimensions": {
"weight": 1000,
"length": 500,
"height": 500,
"width": 500
},
"price": 1000,
"estimatedPrice": 1000
}
]
"packages"=>[
"count"=> 1,
"dimensions"=> [
"weight"=> 1000,
"length"=> 500,
"width"=> 500,
"height"=> 500,
],
"price"=> 1000,
"estimatedPrice"=> 1000
],
"packages"=>[[
"count"=> 1,
"dimensions"=> [
"weight"=> 1000,
"length"=> 500,
"width"=> 500,
"height"=> 500,
],
"price"=> 1000,
"estimatedPrice"=> 1000]
],
$stmt = $conn->prepare(
"UPDATE `sortlist`
SET
`count1` ='count1' + ? ,
`count2` ='count2' + ? ,
`count3` ='count3' + ?
WHERE `id`= ? ;"
);
$stmt->bind_param('iiis', $count1, $count2, $count3, $row);
foreach ($data as $value) {
list($row, $col) = explode("-", $value['id']);
$count1 = 0;
$count2 = 0;
$count3 = 0;
$column = "count" . intval($col);
$$column = $value["count"];
echo "$count1, $count2, $count3, $row";
$stmt->execute();
}
Promise
, async
/ await
– вот это всё.success
<?php
function getOne($conn) {
$result = mysqli_query($conn,"
SELECT *
FROM `stat`
JOIN `order` ON `order`.`id` = `stat`.`order_id`
WHERE `delivery`='Почта' AND `cost`='0'"
);
if (mysqli_num_rows($result)>0) {
while ($row = mysqli_fetch_assoc($result)) {
echo json_encode($row);
}
}
else {
echo "Ошибка в getOne";
}
mysqli_close($conn);
}
$result = mysqli_query($conn, "SELECT * FROM `country` WHERE `city`='Москва'");
$row = mysqli_fetch_assoc($result);
printf('Country ID is: %s', $row['id']);