PHP code example of lightfly / finance

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

    

lightfly / finance example snippets



use GuzzleHttp\Client;
use Lightfly\Finance\HttpClient;
use Lightfly\Finance\Stock\Stock;

$httpClient = new HttpClient(new Client());

$stock = new Stock($httpClient);
$data = $stock->HS300();

var_dump($data);
 
class AnotherHttpClient implements HttpClientInterface
{
    public function get($url, $options = [])
    {
        return file_get_contents($url);
    }
}

$httpClient = new AnotherHttpClient();

$stock = new Stock($httpClient);
$data = $stock->HS300();

var_dump($data);