PHP code example of rankletter / commonmark-ext-seo-image
1. Go to this page and download the library: Download rankletter/commonmark-ext-seo-image 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/ */
rankletter / commonmark-ext-seo-image example snippets
php
use League\CommonMark\Environment;
use RankLetter\CommonMarkImageExtension\SEOImageExtension;
$this->environment = Environment::createCommonMarkEnvironment();
$this->environment->addExtension(new SEOImageExtension);
$converter = new CommonMarkConverter([], $this->environment);
$html = $converter->convertToHtml('![alt text](/path/to/image.jpg)');