Hello, community! I searched on the forums how to get server information using PHP, but I get the error "Data is invalid" using following code:
<?php
class CSocketMTA {
function CSocketMTA( $IP, $PORT = 22003 ) {
if ( $socket = fsockopen( "udp://$IP", $PORT + 123, $errno, $errstr ) ) {
stream_set_timeout( $socket, 1, 0 );
fwrite( $socket, "s" );
$data = fread( $socket, 16384 );
fclose( $socket );
if ( substr( $data, 0, 4 ) == "EYE1" ) {
$data = substr( $data, 4 );
for ( $i = 0; $data != ""; $i++ ) {
if ( substr( $data, 0, 2 ) == chr( 1 ) . "?" )
$dat