PHP code example of bloghunch / php-sdk

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

    

bloghunch / php-sdk example snippets


use Bloghunch\Bloghunch;
use Bloghunch\Exceptions\BloghunchException;

$bloghunch = new Bloghunch('your-api-key', 'your-domain');

try {
    $posts = $bloghunch->getAllPosts();
    print_r($posts);
} catch (BloghunchException $e) {
    echo "Error: " . $e->getMessage();
}
bash
composer