1. Go to this page and download the library: Download devscast/pexels 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/ */
devscast / pexels example snippets
// ...
use Devscast\Pexels\Client;
// ...
$pexels = new Client(token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$photos = $pexels->searchPhotos('Tigers');
// landscape photos only
$photos = $pexels->searchPhotos('Tigers', new SearchParameters(orientation: 'landscape', page: 2))