```php
<?php
function fetch() {
$url = '
https://steamcommunity.com/app/200210'; $ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 3,
CURLOPT_URL => $url,
CURLOPT_HEADER => [
'User-Agent' =>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36',
],
]);
return curl_exec($ch);
}
function parseHTML( $html) {
if (!$html) {
return '';
}
libxml_use_internal_errors(true);
$dom = new DOMDocument('1.0');
$dom->preserveWhiteSpace = true;
$dom->loadHTML($html);
$xpath =new DOMXPath($dom);
$node = $xpath->query('//span[@class="apphub_NumInApp"]');
$text = $node->item(0)->textContent;
// 有可能是中文,以空格分隔
list($onlineCount, $left) = sscanf($text, '%s %s');
return str_replace( ',', '', $onlineCount);
}
$result = parseHTML(fetch());
var_dump($result);
```