Last active
May 13, 2020 07:40
-
-
Save PJZ9n/b4e5404d37b15553d5bbd0ee15894bbd to your computer and use it in GitHub Desktop.
プレイヤーの名前を取得する(array_map使用)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
/** @var \pocketmine\Server $server */ | |
$players = implode(", ", array_map(function (\pocketmine\Player $player): string { | |
/** @var \pocketmine\Player $player */ | |
return $player->getName(); | |
}, $server->getOnlinePlayers())); | |
var_dump($players);//string "Steve, Alex, Foo, Bar" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment