PHP code example of imagin / fotolia-api

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

    

imagin / fotolia-api example snippets




$api = new Fotolia_Api('your_api_key');

// searching for files
$results = $api->getSearchResults(
    array(
        'words' => 'car',
        'language_id' => Fotolia_Api::LANGUAGE_ID_EN_US,
        'limit' => 1,
    ));

printf("Found %d results", $results['nb_results']);

foreach ($results as $key => $value) {
    // iterating only over numeric keys and silently skip other keys
    if (is_numeric($key)) {
        printf("matching media ID: %d", $value['id']);
    }