PHP code example of iceqi / pexels

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

    

iceqi / pexels example snippets


$pexels = new \Glooby\Pexels\Client("xxxxx");

$response = $pexels->search('london');

$images = json_decode($pexels->search('london')->getBody())->images;
foreach ($images as $image) {
 echo "<img src='{$image->src->small}' width='{$image->width}' heigth='{$image->height}'>"
}