PHP code example of shamanzpua / yii2stackexchange

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

    

shamanzpua / yii2stackexchange example snippets



'stackexchange' => [
    'class' => 'shamanzpua\yii2stackexchange\Stackexchange',
    'apiKey' => 'YOUR_API_KEY',
    'apis' => [
        'stackoverflow' => [
        'class' => 'shamanzpua\stackexchange\Stackoverflow'
        ],
    ],
]



$stack = Yii::$app->stackexchange->getApi('stackoverflow');
$data = $stack->grab('search keyword');