PHP code example of mcprohosting / skinner

1. Go to this page and download the library: Download mcprohosting/skinner 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/ */

    

mcprohosting / skinner example snippets


// Example 1: save a player's skin and head to a file:
file_put_contents('steve_skin.png', Skinner::user('steve')->skin());
file_put_contents('steve_skin.png', Skinner::user('steve')->head());

// Or, more efficiently, in a way that will only cause the skin to be downloaded once

$user = Skinner::user('steve');
file_put_contents('steve_skin.png', $user->skin());
file_put_contents('steve_skin.png', $user->head());

// Calls to the $user are automatically passed to Intervention images. So you can, for example:

$user = Skinner::user('steve');
file_put_contents('steve_skin.png', $user->skin()->resize(300, 300));

// Or, manually save it in another format, like jpg at 70% quality

$user = Skinner::user('steve');
file_put_contents('steve_skin.jpg', $user->encode('jpg', 70));