PHP code example of lotfio / vstat

1. Go to this page and download the library: Download lotfio/vstat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lotfio / vstat example snippets


use Vstat\Vstat;

Clients());

// get all vatsim clients
print_r((Vstat::getClients()));

// get prefile plans
print_r((Vstat::getPreFile()));

// get vatsim servers
print_r((Vstat::getServers()));

// get vatsim voice servers
print_r((Vstat::getVoiceServers()));

// filters
// show by Type ATC or PILOT by default show by PILOT
print_r((Vstat::showByType('ATC')));

// show by airline
print_r((Vstat::showByAirline('BAW')));

// show by callsign
print_r((Vstat::showByCallsign('BAW96')));

// show by vatsim id
print_r((Vstat::showByVatsimId(131)));

// get number of pilots
print_r((Vstat::getNumberOfPilots()));

// get number of controllers
print_r((Vstat::getNumberOfControllers()));

// get number of clients connected with the same airline
echo count(Vstat::showByAirline('DAH'));

// get data as json formt
print_r(json_encode(Vstat::showByAirline('DAH')));