The player class is a sub class of Position (Entity extends position, Player is a sub class of Entity) meaning the player itself can be passed as a position object and you can use the x, y, z and level properties. Alternatively you can use Player::getPosition() which returns a Position object.
You might want to look at https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/level/Position.php and https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/math/Vector3.php to figure out what you can do with a Position object.
Learn OOP. Passing structured data as objects is almost always better than passing as arrays. Although PHP supports associative arrays, it is better to use them as (dynamic size and keySet) maps instead of structured objects.
use this PHP: round($player->getX()) . " §e/ " . round($player->getY()) . " / " . round($player->getZ()) . "'");
This does not give you the player position. This gives you the human-readable text that reflects the position, but not the position itself. You can't carry out calculations on the position with this. What is that?
The thread is asking how to get a position. It is not asking how to display the coordinates. Nor is it asking how to display the coordinates, much less display colorfully, especially when only Y and Z are colored.
Yes, he knows. But this thread is not asking how to get a human readable string with colors. It asks how to get the Position/Vector3 object or the position ints of a player.
Lets say you have to defined $player already $x = $player->getX(); Gets X Position $y = $player->getY(); Gets Y Position $z = $player->getZ(); Gets Z Position $level = $player->getLevel(); Gets The Players Current Level