PHP code example of paulgessinger / jsonrpc

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

    

paulgessinger / jsonrpc example snippets


use PG\JsonRpc\Server ;

;

$server->expose('Sample', 'PG\JsonRpc\tests\sample\Sample') ;

$server->run() ;

namespace PG\JsonRpc\tests\sample;
use PG\JsonRpc\Exception\ArgumentException;

class Sample {
    public function divide($a, $b) {
        return $a/$b ;
    }
	
	// ...
}