$file = CFile::MakeFileArray(
$_SERVER['DOCUMENT_ROOT'].'/upload/payment/'.$_GET['ORDER_ID'].'.pdf',
false,
false,
''
);
$fileSave = CFile::SaveFile(
$file,
'/payment',
false,
false
);
CEvent::Send(
'SEND_PAY_PDF',
's1',
array('EMAIL_TO' => $USER->getEmail()),
'N',
'',
array($fileSave),
'ru'
);
<ul id="list">
<li class="yes">1</li>
<li class="no">2</li>
<li class="no">3</li>
<li>...</li>
<li class="yes">100</li>
</ul>
function on(elSelector, eventName, selector, fn) {
var element = document.querySelector(elSelector);
element.addEventListener(eventName, function(event) {
var possibleTargets = element.querySelectorAll(selector);
var target = event.target;
for (var i = 0, l = possibleTargets.length; i < l; i++) {
var el = target;
var p = possibleTargets[i];
while(el && el !== element) {
if (el === p) {
return fn.call(p, event);
}
el = el.parentNode;
}
}
});
}
on('#list', 'click', '.yes', function(e) {
// this function is only called, when a list item with 'yes' class is called
console.log(e.target); // this is the clicked list item
});
$addres.val("Мои данные").change();
.change()
на [0].dispatchEvent(new Event('input'))
. $str1 = 'Lorem {val1} dolor sit {val2}, consectetur adipisicing {val3}';
$str2 = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit';
$words1 = explode(' ', $str1);
$words2 = explode(' ', $str2);
$items = count($words1);
$result = [];
for($i = 0; $i< $items; $i++) {
if(preg_match('/{\w*}/', $words1[$i])) {
$result["$words1[$i]"] = $words2[$i];
}
}
print_r($result);
$mask = "Lorem {val1} dolor sit {val2}, consectetur adipisicing {val3}.";
$str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit.";
preg_match_all("/({.*?})/", $mask, $mask_matches);
$re = '/^' . preg_replace("/\\\{.*?\\\}/", '(.*?)', preg_quote($mask, '/')) . '$/';
preg_match($re, $str, $str_matches);
array_shift($str_matches);
$result = array_combine($mask_matches[1], $str_matches);
print_r($result);
Array
(
[{val1}] => ipsum
[{val2}] => amet
[{val3}] => elit
)
$s1 = 'Lorem {val1} dolor sit {val2}, consectetur adipisicing {val3}.';
$s2 = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.';
$patterns = [];
$pattern2 = preg_replace_callback('|\{([a-z0-9]+)\}|', function($m) use (&$patterns) {
$patterns[] = $m[1];
return '(.*)';
}, $s1);
preg_match('|' . $pattern2 . '|', $s2, $matches);
$res = array_combine($patterns, array_slice($matches, 1));
var_dump($res);
Надеюсь меня тут поругают и ответят как надо было побороть эту проблему.
proxy_buffering on
<input type="password" name="password" autocomplete="new-password">