PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
  Classes of Markus Schanz  >  Counter-Strike  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Short example on how to use the class
Class: Counter-Strike
Retrieve information from a Counter-Strike server
Author: By
Last change:
Date: 11 years ago
Size: 391 bytes
 

 

Contents

Class file image Download
<?php
include("class_cstrike.php");

$server = new cstrike("88.198.35.40", 27100);

$infoarrays = $server->getInfo();

echo
$infoarrays["serverinfo"]["servername"] . " has " . $infoarrays["serverinfo"]["player_cur"] . "/" . $infoarrays["serverinfo"]["player_max"] . " players!";

// Uncomment for the full data array, view source of the page to see it!
// print_r($infoarrays);
?>