PHP code example of omnilab / worms

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

    

omnilab / worms example snippets


$worms = (new WormsSourceFactory($http))->create(['mailto' => '[email protected]']);
$dolphin = $worms->entity('137094');              // or 'worms:137094', its LSID, its page, 'Delphinus delphis',
                                                  // Identifier::of(Scheme::ITIS, '180438'), 'iucn:134817215'
$dolphin->identifiers()->keys();                  // worms:137094, itis:180438, ncbi.taxon:9728, iucn:134817215
$dolphin->value('lineage');                       // Biota > Animalia > Chordata > ... > Delphinidae > Delphinus
$dolphin->related('synonym')->keys();             // the 24 synonyms' AphiaIDs (worms:383799...)
$dolphin->value('citation');                      // Fordyce, E.; Perrin, W.F. (2026). World Cetacea Database...

$worms->search(new Query('Delphinus', limit: 10));  // the names beginning with it, 50 a page at most



mnilab\Worms\WormsSourceFactory;

$worms = (new WormsSourceFactory())->create(['mailto' => '[email protected]']);   // your address, in the User-Agent
$dolphin = $worms->entity('137094');
echo $dolphin->label, ': ', implode(', ', $dolphin->identifiers()->keys()), "\n";