PHP code example of simbiat / htmlcut

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

    

simbiat / htmlcut example snippets


Cut(\DOMNode|string $string, int $length, int $paragraphs = 0, string $ellipsis = '…', bool $stripUnwanted = true)


$doc = new DOMDocument();
$doc->loadHTML('<div>Testing cutting function</div>');
echo \Simbiat\HTMLCut::Cut($doc, 10);
exit;