PHP code example of econtract / compare

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

    

econtract / compare example snippets



    'providers'             => array(

        //...
        \Econtract\Compare\CompareServiceProvider::class,

    )



    'facades'               => array(

        //...
        'Api'                   => \Econtract\Compare\Facades\Compare::class,

    ),


    
    $products = Api::getProducts(
        array(
            'sg'        => 'consumer',
            'cat'       => 'internet',
            'lang'      => 'nl',
        )
    );

    $suppliers = Api::getSuppliers(
        array(
            'sg'        => 'consumer',
            'cat'       => 'internet',
            'lang'      => 'nl',
        )
    );

    $comparisons = Api::createComparison(
        array(
            'sg'        => 'consumer',
            'cat'       => 'gas',
            'lang'      => 'nl',
            'u'         => '4000',
            'ut'        => 'kwh',
            'zip'       => '3540',
            't'         => 'no',
            'd'         => '0',
        )
    );



     use Econtract/Compare/CompareService;


    $dotenv = new Dotenv\Dotenv(__DIR__);
    $dotenv->load();


    $compareService = new CompareService();
    $compareService->getProducts(
        array(
            'sg'        => 'consumer',
            'cat'       => 'internet',
            'lang'      => 'nl',
        )
    );