<?php
//отправляем ответ 200 и закрываем соединение
http_response_code(200);
fastcgi_finish_request();
//тут долгая задача
<?php
ob_start();
http_response_code(200);
header("Connection: close\r\n");
header("Content-Encoding: none\r\n");
$size = ob_get_length();
header("Content-Length: ". $size . "\r\n");
ob_end_flush();
flush();
//тут долгая задача в фоне
$weight = round($weight, 2);
$order_weight = round($order_weight, 2);
if ($weight == $order_weight) {
var_dump('ok');
} else {
var_dump($weight);
var_dump($order_weight);
var_dump(gettype($weight));
var_dump(gettype($order_weight));
}
$re = '/href="([^#]*?)(#[^"]*?)"/m';
$subst = 'href="$1"';
$str = '<a href="/#abc">test</a>
<a href="#def">test2</a>
<a href="/index.php?a=1#feg">test3</a>
<a href="/test.php?c=2">test4</a>
<a href="/test">test5</a>';
$result = preg_replace($re, $subst, $str);
echo $result;
preg_match_all('~<paramname[^<]*<!\[CDATA\[(.+)\]\]>[^<]*<\/paramname>~', $text, $matches);
<?php
$xml = simplexml_load_string($text, null, LIBXML_NOCDATA);
print_r((array)$xml->characteristics->paramvalue);
{}
$code = <<<JAVASCRIPT
var group_id = {$type_payload->group_id};
JAVASCRIPT;
https://transparencyreport.google.com/transparencyreport/api/v3/safebrowsing/status?site=discord-free.com
cd
в нужную директориюexec("cd /path/to/files && npx @squoosh/cli --mozjpeg '{quality:95}' -s 'new' '26.jpg'", $output, $return_var);
which npx
<?php
$public_key = 'wlSd17awInb86dKaEyaWMIuxYu7DtjBEGIsHtLud';
$secret_key = 'IsWd4RoRb2GxB6afz5qI0CsqHCQTTpEZLfdb2vJH';
$api_path = "/v3/auth/r/wallets";
//$nonce = strval(date_timestamp_get(date_create())*1000);
$nonce = (string)round(microtime(true)*1000);
$content = "{}";
$signature = hash_hmac("sha384", $api_path.$nonce.$content, $secret_key);
$result = file_get_contents("https://api.kuna.io".$api_path, false, stream_context_create([
"http" => [
"method" => "POST",
"header" => [
"accept: application/json",
"content-type: application/json",
"kun-nonce: {$nonce}",
"kun-apikey: {$public_key}",
"kun-signature: {$signature}",
],
"content" => $content,
]
]));
var_dump($result);