PHP code example of crodas / api-server

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

    

crodas / api-server example snippets




$api = new crodas\ApiServer(
    __DIR__ . '/src/services' // my apis
);

$api->main();

/** @API array_sum */
function do_array_sum($args, $server) {
    return array('array_sum' => array_sum($args));
}