<?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);