You have to have PHP 7 running on your system. As I personally don’t have that I use my raspberry pi to code the sample. Check your installation by printing the version.
pi@raspy:~ $ php -v PHP 7.0.33-0+deb9u12 (cli) (built: Oct 26 2021 17:51:39) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.33-0+deb9u12, Copyright (c) 1999-2017, by Zend Technologies
<?php $uri = 'http://api.football-data.org/v4/competitions/PL/matches/?matchday=22'; $reqPrefs['http']['method'] = 'GET'; $reqPrefs['http']['header'] = 'X-Auth-Token: UR_TOKEN'; $stream_context = stream_context_create($reqPrefs); $response = file_get_contents($uri, false, $stream_context); $matches = json_decode($response); var_dump($matches); ?>
Big thanks go to Einar Hansen who recently published his PHP library code. It’s offers some sophisticated functions and is well documented, even integration into the Laravel framework is dealt with.
Also there is a small library I once wrote to showcase some basic functions. You can use this is a very basic ramp-up as well.
docker-compose up -d
After that open localhost:9988 in your browser.