if (isset($item["IBLOCK_ID"])
&& is_array($arSelectFields)
&& in_array("ElementValues", $arSelectFields))
{
// code
}
function toCart(e, handleResponse) {
const req = new XMLHttpRequest();
...
req.onload = function() {
handleResponse(this.response);
}
}
function btnClick(e) {
...
toCart([name, size], function(response) {
console.log(response);
});
}
$o = preg_replace('/(<img\s.*\ssrc=".*?)h2_(.*?)"/', '$1p_$2', $s);
$dealsMap = array_combine(array_column($deals, 'id'), $deals);
print_r($dealsMap);
foreach ($ads as $ad) {
$idDeal = $ad['idDeal'];
if (!isset($dealsMap[$idDeal]['dateStop'])
|| ($dealsMap[$idDeal]['dateStop'] < $ad['dateStop'])) {
$dealsMap[$idDeal]['dateStop'] = $ad['dateStop'];
}
}
print_r($dealsMap);
<form onsubmit="КАКАЯ_ТО_ФУНКЦИЯ(this.id)">
DELIMITER $$
CREATE TRIGGER after_members_insert
AFTER INSERT
ON members FOR EACH ROW
BEGIN
IF NEW.birthDate IS NULL THEN
INSERT INTO reminders(memberId, message)
VALUES(new.id,CONCAT('Hi ', NEW.name, ', please update your date of birth.'));
END IF;
END$$
DELIMITER ;
$source = [...];
$words = ['куплю', 'продам'];
$result = array_filter($source, function($item) use ($words) {
return count(array_filter($words, function($word) use ($item) {
return mb_stripos($item, $word) !== false;
}));
});