PHP code example of megachriz / listconvert

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

    

megachriz / listconvert example snippets


$html = '
<ol>
  <li>First item</li>
  <li>
    Second item
    <ol type="a">
      <li value="3">Item C</li>
      <li>Item D</li>
    </ol>
  </li>
  <li>Third item</li>
</ol>';
$converter = new \megachriz\ListConvert\Html2Text($html);

print $converter->getText();

$html = '
<ol>
  <li>First item</li>
  <li>
    Second item
    <ol type="a">
      <li value="3">Item C</li>
      <li>Item D</li>
    </ol>
  </li>
  <li>
    Third item
    <ol type="I">
      <li>Alpha</li>
      <li>Beta</li>
      <li>
        <ol type="a">
          <li>Item A</li>
          <li>Item B</li>
        </ol>
      </li>
    </ol>
  </li>
</ol>';
$converter = new \megachriz\ListConvert\Html2Text($html);

print $converter->getListSummary();