PHP code example of ibraheem-ghazi / heading-parser

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

    

ibraheem-ghazi / heading-parser example snippets


paramters:
$code // the html code for topic or post

return array of HtmlHeading 



braheemGhazi\HeadingParser\HtmlHeadingParser;

$code = "";
$code  .= "<h2>Heading 2</h2>";
$code .=    "<h3>Heading 3</h3>";
$code .=        "<h4>Heading 4</h4>";
$code .=        "<h4>Heading 4</h4>";
$code .=            "<h5>Heading 5</h5>";
$code .=        "<h4>Heading 4</h4>";
$code .=    "<h3>Heading 3</h3>";
$code .= "<h2>Heading 2</h2>";
$code .=    "<h3>Heading 3</h3>";
$code .=    "<h3>Heading 3</h3>";
$code .=        "<h4>Heading 4</h4>";
$code .=         "<h5>Heading 5</h5>";
$code .=         "<h5>Heading 5</h5>";
$code .=           "<h6>Heading 6</h6>";
$code .= "<h2>Heading 2</h2>";

var_dump(HtmlHeadingParser::parse($code));