PHP code example of yggverse / gemtext
1. Go to this page and download the library: Download yggverse/gemtext 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/ */
yggverse / gemtext example snippets
php
// Load document from file
$document = new \Yggverse\Gemtext\Document(
file_get_contents(
'tests/data/document.gmi'
)
);
// Get links
foreach ($document->getLinks() as $link)
{
print(
$link->toString()
);
}