PHP code example of donatj / mddom

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

    

donatj / mddom example snippets




use donatj\MDDom;

t;

$doc->appendChild(new MDDom\Header("Hello World!"));
$doc->appendChild(new MDDom\Paragraph("This text is in a paragraph"));
$doc->appendChild(new MDDom\Paragraph("This text is in a separate paragraph"));

$sub = new MDDom\DocumentDepth;
$doc->appendChild($sub);

// Header Level, e.g. <h2> is determined by the depth.
$sub->appendChild(new MDDom\Header("Sub-Header!"));
$sub->appendChild(new MDDom\CodeBlock("echo 'Hello World';", 'php'));

echo $doc->exportMarkdown();


echo 'Hello World';