PHP code example of mikone / pubmed

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

    

mikone / pubmed example snippets


$api = new PubMed\Term();
$api->setReturnStart(10); // set first returned articles, defaults to 0, helpful in case of pagination
$api->setReturnMax(100); // set max returned articles, defaults to 10
$articles = $api->query('CFTR');
print_r($articles);

$api = new PubMed\Term();
$api->setReturnStart(10); // set first returned articles, defaults to 0, helpful in case of pagination
$api->setReturnMax(100); // set max returned articles, defaults to 10
$articles = $api_->query('CFTR', $params);
print_r($articles);

$api = new PubMed\PubMedId();
$article = $api->query(15221447);
print_r($article);

options['articles'] = true;

or 

$params = {'articles' => true, 'summary' => 'true', 'page' => 2};