$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; 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); <?php
$val = "NEW";
$arr = [1 => "red", 2 => "green", 3 => "blue", 4 => "yellow"];
//находим индекс элемента со значением "green"
$index = array_search("green", $arr);
//получаем срез массива до элемента "green" включительно
$tmp_arr = array_slice($arr, 0, $index);
//вставляем новый элемент после "green"
$tmp_arr[] = $val;
//собираем новый массив
$arr = array_merge(
$tmp_arr,
array_slice($arr, $index, count($arr))
);
print_r($arr); CallbackQuery появится в списке который возвращает метод /getUpdatesCallbackQuery в формате JSON.echo складывайте результаты в переменную//изначальное состояние - пустая строка
$content = "";
foreach ($data2 as $reposit2) {
//добавляем содержимое в цикле
$content .= '<div class итд';
}
//в нужном месте
echo $content;return $content; - то есть возвращаем строку с кусками html и дальше используем этот результат по своему усмотрению.