PHP code example of louisperre / composer-td3

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

    

louisperre / composer-td3 example snippets




use louisperr/ApiTmdb;

$api = new ApiTmdb();
$categories = $api->getNameCategories() // array

$client = HttpClient::create();
$response = $client->request(
    'GET',
    'url'    
);
$content = $response->getContent();

$crawler = new Crawler($content);
$list = $crawler
    ->filter('CSS SELECTOR')
    ->reduce(function (Crawler $node, $i) use (&$array) : bool {
        foreach ($node->filter('selector') as $something) {
            // Do something
        }
    })