PHP code example of tibiasolutions / tibia-parser

1. Go to this page and download the library: Download tibiasolutions/tibia-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tibiasolutions / tibia-parser example snippets




use TibiaParser\Player;

$player = new Player('Kharsek');
if ($player->exists) {
	var_dump($player);
} else {
	echo 'Character does not exist.';
}



use TibiaParser\World;

$world = new World('Antica');
if ($world->error != NULL) {
	echo $world->error;
} else {
	var_dump($world->information);
	foreach ($world->players as $player) {
		var_dump($player);
	}
}

// Get all World Names
var_dump(World::getWorlds());
bash
php composer.phar