Loading...
Свободное общение | preg_match опять))
ddarder ,
Я убрал http:// что бы не било код, так что если что подставь.
<?php

$map = 'Unknown';
$ip = '127.0.0.1:27015';
$player = [0, 0];

if($curl = curl_init('monitor-css.ru/components/html0/&host=85.143.221.165:27015'))
{
curl_setopt($curl,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl,CURLOPT_REFERER,'monitor-css.ru');
curl_setopt($curl,CURLOPT_TIMEOUT,30);
curl_setopt($curl,CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($curl);
curl_close($curl);
preg_match_all('#<div class="item_float_right">(.*?)</div>#us', $html, $matches);
$map = trim(strip_tags($matches[1][1]));
$ip = trim(strip_tags($matches[1][0]));
$player = explode('/', trim(strip_tags($matches[1][2])));
}

echo '<pre>';
echo $map . PHP_EOL;
echo $ip . PHP_EOL;
echo $player[0] . ' из ' . $player[1] . PHP_EOL;
?>

Вывод: http://prntscr.com/myc2m0
________
посл. ред. 15.03.2019 в 17:55; всего 3 раз(а); by null
ddarder ,

Сам класс:
https://mixta.ru/c/124de0d633

Код:
https://mixta.ru/c/84b7d36045

Вывод:
Онлайн: 6
Время:
Gen. 0.0708
(c) Bym.Guru 2010-2026