You certainly can and below is a cut down version, but first an explantion. THis is not the actually script thats a tad more complex but i know i having problems with this so i thought fix this bit first. The below script only read from the socket ONCE. And it works it gets the first 80 chars however if i make read from the socket more than once it hangs 馃檨 i know there is more info at least 200 chars.
The stuff that is written to server makes the server respond with the info i need. If you want more info i can send u the txt file that explains it more or if u have the Half-Life SDK look at the server-protcol.txt .
<?PHP
$fp = fsockopen("udp://193.82.159.232", 27015, &$errno, &$errstr);
if (!$fp)
{
echo "ERROR: $errno - $errstr<br>\n";
}
else
{
fwrite($fp,"每每每每details\x00");
$place = 5;
$got = 0;
while($got < 1)
{
$got++;
$buffer = fread($fp, 80);
print( " $got: $buffer \n ");
}
fclose($fp);
}
?>