PHP - 从函数读取返回的数组
require('mq_class.php');
print_r(Minequery::query("64.31.24.137"));
返回:
Array ( [serverPort] => 25565 [playerCount] => 6 [maxPlayers] => 40 [playerList] => Array ( [0] => Uthly [1] => epson8 [2] => CheeseBricks [3] => Truth92 [4] => zerokhaos [5] => plainlazy95 ) [latency] => 25.8100032806 )
现在,我将如何读取,例如 serverPort
(变量)或 playerList
(这是一个数组)?
我学PHP有一段时间了,我想我只知道一点点。
require('mq_class.php');
print_r(Minequery::query("64.31.24.137"));
returns:
Array ( [serverPort] => 25565 [playerCount] => 6 [maxPlayers] => 40 [playerList] => Array ( [0] => Uthly [1] => epson8 [2] => CheeseBricks [3] => Truth92 [4] => zerokhaos [5] => plainlazy95 ) [latency] => 25.8100032806 )
Now, how would I read, say serverPort
(a variable) or playerList
(which is an array)?
I've done PHP for a while now, I guess I know only a little amount.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用此代码:
Use this code:
阅读 PHP 数组
Read up on PHP Arrays