Skip to content

PHP library for parsing Swiss Lotto and Euro Millions results.

Notifications You must be signed in to change notification settings

mhauri/lotto-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Codacy Badge Codacy Badge

Lotto Parser

PHP library for parsing Swiss Lotto and Euro Millions results from Swisslos.

Installation

composer require mhauri/lotto-parser  

Usage

To get the latest results from Swiss Lotto

     <?php    
     
     use LottoParser\Client\SiwssLotto    
     $lotto = new SwissLotto();      
        
     $data = $lotto->current()->get();    
     // to Array    
     $data = $lotto->current()->toArray();    
     // to JSON    
     $data = $lotto->current()->toJson(); 

To get the results from a specific date

	
    <?php    
	
    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();

The same applies for Euro Millions, just replace $lotto = new SwissLotto() with
$lotto = new EuroMillions();

Support

If you have any issues with this library, open an issue on GitHub.

Contribution

Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.

Developer

Marcel Hauri, and all other contributors

License

MIT

About

PHP library for parsing Swiss Lotto and Euro Millions results.

Topics

Resources

Stars

Watchers

Forks

Languages