Php minecraft服务器查询未回显motd

Php minecraft服务器查询未回显motd,php,minecraft,Php,Minecraft,我从这里下载了代码: 我想回显服务器的MOTD,代码如下: <?php include_once 'get.php'; //include the class $status = new MinecraftServerStatus(); // call the class $response = $status->getStatus('localhost'); // call the function $statusTxt = "offline"; $version ="N/A

我从这里下载了代码:

我想回显服务器的MOTD,代码如下:

<?php

include_once 'get.php'; //include the class
$status = new MinecraftServerStatus(); // call the class

$response = $status->getStatus('localhost'); // call the function

$statusTxt = "offline";
$version ="N/A";
$ping ="N/A";
$players = "0/0";
$host = "N/A";
$motd = "N/A";
$version= "N/A";

if($response){
    $statusTxt="online";
    $players = $response['players'] . "/" . $response['maxplayers'];
    $version = $response['version'];
    $ping = $response['ping'];
    $host = $response['hostname'];
    $motd = $response['motd'];
    $version = $response['version'];
}

?>
<div id="banner">
<div id="status"><?php
echo$statusTxt;
?></div>
<div id="version"><?php
echo$version;
?></div>
<div id="ping"><?php
echo$ping;
?></div>
<div id="players"><?php
echo$players; 
?></div>
<div id="host"><?php
echo $host; 
?></div>
<div id="motd"><?php
echo $motd; echo $version;
?></div>
</div>

如何回显服务器的MOTD?

我建议改用Auto Bukkit,它对于minecraft服务器非常简单,MOTD在100%的时间内都能工作。

您的MOTD是否有任何奇怪的字符或颜色代码?尝试将MOTD改为简单,然后看看是否能工作。我看不出还有什么其他原因不能证明这一点。
online
103
3/100
localhost
1.7.5