1. Go to this page and download the library: Download decodelabs/metamorph library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
decodelabs / metamorph example snippets
useDecodeLabs\Metamorph;
// Default Markdown rendersecho Metamorph::markdown($markdownContent);
// Ensure output is secure from exploits with "safe" macroecho Metamorph::{'markdown.safe'}($markdownContent);
// Output inline markupecho Metamorph::{'markdown.inline'}($markdownContent);
echo Metamorph::text('Hello world', [
'maxLength' => 5// shorten output with ellipsis'ellipsis' => '...'// Character(s) used while shortening string (optional)'wrap' => true// Wrap output as HTML markup
]);
// wrap=falseecho Metamorph::{'text.raw'}($longText);
// maxLength=50, wrap=trueecho Metamorph::{'text.preview'}($longText);
// maxLength=50, wrap=falseecho Metamorph::{'text.preview.raw'}($longText);
echo Metamorph::htmlToText('<p>This is an HTML paragraph</p>', [
'maxLength' => 5// shorten stripped output with ellipsis'ellipsis' => '...'// Character(s) used while shortening string (optional)'wrap' => true// Wrap the stripped text in Markup element
]);
// Strip and re-wrap HTMLecho Metamorph::{'htmlToText.wrap'}($html);
// maxLength=50, wrap=trueecho Metamorph::{'htmlToText.preview'}($html);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.