PHP code example of hugo-levet / strapi-php-rich-text-parser
1. Go to this page and download the library: Download hugo-levet/strapi-php-rich-text-parser 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/ */
hugo-levet / strapi-php-rich-text-parser example snippets
use HugoLevet\StrapiPhpRichTextParser\RichTextParser;
$html_content = RichTextParser::jsonToHtml($content);
$shortcodes = [
'shortcode' => 'shortcodeFunction'
];
function shortcodeFunction($element)
{
return 'Wubba Lubba Dub Dub';
}
$html = jsonToHtml($json, $shortcodes);
echo $html;