Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lista Graczy
#2
Jeśli ktoś nie chce integrować bazy danych to można też podebrać z listy serwerów, np.


Code:
<?php
    $ip = '155.133.40.158:28970';    

    $context = stream_context_create(array(
        'http' => array(
        'timeout' => 2
        )
    ));

    $g2o = @file_get_contents('http://gothic-online.com.pl/?p=servers', NULL, $context);
    $index = strpos ($g2o, $ip);
    if($index>0){
        $index += strlen('<td>') + strlen($ip) + 1;
        $index2 = strpos($g2o, '</td>', $index);
        echo 'Online: '.substr($g2o, $index, $index2-$index);
    }
    else echo 'Online: brak danych';
?>


Pozdrawiam serdecznie użytkowników.
Reply


Messages In This Thread
Lista Graczy - by Quarchodron - 19.12.2016, 21:34
RE: Lista Graczy - by Marcel - 20.12.2016, 22:34

Forum Jump:


Users browsing this thread: 1 Guest(s)