PHP code example of astronati / sportmediaset-api-response-parser

1. Go to this page and download the library: Download astronati/sportmediaset-api-response-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/ */

    

astronati / sportmediaset-api-response-parser example snippets


use SMRP\Response\Parser\ResponseParser;
...
// Obtain a Response
$apiResponse = ... // Save this the response from the SportMediaset API
$response = ResponseParser::create($apiResponse, ResponseParser::GET_TEAM_FORMATION);
...
// Get Juventus formation
$formation = $response->getTeamFormationModel();
echo $formation->getCoach(); // Sarri