PHP code example of mhauri / lotto-parser
1. Go to this page and download the library: Download mhauri/lotto-parser 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/ */
mhauri / lotto-parser example snippets
use LottoParser\Client\SiwssLotto
$lotto = new SwissLotto();
$data = $lotto->current()->get();
// to Array
$data = $lotto->current()->toArray();
// to JSON
$data = $lotto->current()->toJson();
use Carbon\Carbon;
use LottoParser\Client\SiwssLotto
$lotto = new SwissLotto();
$date = Carbon::create(2021,02,13);
$data = $lotto->byDate($date)->get();
// to Array
$data = $lotto->byDate($date)->toArray();
// to JSON
$data = $lotto->byDate($date)->toJson();