if (isset($item["IBLOCK_ID"])
&& is_array($arSelectFields)
&& in_array("ElementValues", $arSelectFields))
{
// code
}
$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);
$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;
}));
});
$sql = "INSERT INTO orders (email) VALUES ('$email')";
/[^a-zA-ZА-Яа-я_-\s]/u
/[^a-zA-ZА-Яа-я_\-\s]/u
/[^a-zа-я_\-\s]/iu
$sql = 'SELECT * FROM bid b
LEFT JOIN currency c USING(currency_id)
LEFT JOIN rate r USING(rate_id)'
. (isset($_POST['type_name'])? ' LEFT JOIN type t USING(type_id) WHERE t.type_name = :typeName': '');
$result = $db->prepare($sql);
if(isset($_POST['type_name'])) {
$result->bindParam(':typeName', $_POST['type_name'], PDO::PARAM_STR);
}
$result->execute();
function actionworld() {
var win = window.open('', 'test');
win.document.write('Hello, World!!!');
}
function myFunction(stdClass $node) {
// doing something
}