An open API service indexing awesome lists of open source software.

https://github.com/fragland/minestat_package

PHP/Packagist/composer package for Minestat
https://github.com/fragland/minestat_package

minecraft php

Last synced: 8 months ago
JSON representation

PHP/Packagist/composer package for Minestat

Awesome Lists containing this project

README

          

# minestat_package
PHP/Packagist/composer package for [MineStat](https://github.com/FragLand/minestat)

### PHP example

**Note:** MineStat for PHP requires multi-byte string support to handle character encoding conversion. Enabling `mbstring` support can be as simple as installing the `php-mbstring` package for your platform. If building PHP from source, see https://www.php.net/manual/en/mbstring.installation.php. To validate, `phpinfo()` output will reference `mbstring` if the feature is enabled.

```php
", $ms->get_address(), $ms->get_port());
if($ms->is_online())
{
printf("Server is online running version %s with %s out of %s players.
", $ms->get_version(), $ms->get_current_players(), $ms->get_max_players());
if($ms->get_request_type() == "Bedrock/Pocket Edition")
printf("Game mode: %s
", $ms->get_mode());
printf("Message of the day: %s
", $ms->get_motd());
printf("Message of the day without formatting: %s
", $ms->get_stripped_motd());
printf("Latency: %sms
", $ms->get_latency());
printf("Connected using protocol: %s
", $ms->get_request_type());
}
else
{
printf("Server is offline!
");
}
?>
```