PHP code example of leamare / simple-opendota-php

1. Go to this page and download the library: Download leamare/simple-opendota-php 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/ */

    

leamare / simple-opendota-php example snippets



$od = new \SimpleOpenDotaPHP\odota_api();

$res = $od->match(1234567902);

$od = new odota_api(true);

$res = $od->player(123123123);

$od = new odota_api(true, "localhost", 100);

$res = $od->live();

$od->set_get_callback(function($url, $data) {
  return $url.' '.json_encode($data);
});

$od->set_request_callback(function($url, $data, $post) {
  return 'R '.$url.' '.json_encode($data);
});