PHP code example of jarne / querylibrary

1. Go to this page and download the library: Download jarne/querylibrary 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/ */

    

jarne / querylibrary example snippets


/**
 * Fetch query information of a server
 *
 * @param string $ip
 * @param int $port
 * @param int $timeoutSeconds
 *
 * @return Result
 */
public function fetch(
    string $ip,
    int $port = 19132,
    int $timeoutSeconds = 5
): Result

$queryLibrary = new QueryLibrary();
$result = $queryLibrary->fetch("127.0.0.1");

echo "The default level name is " . $result->getDefaultLevelName();