PHP code example of swisnl / textsnippet

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

    

swisnl / textsnippet example snippets


$snippet = new TextSnippet()
$snippet->createSnippet('Lorem', $lorumIpsum);

$snippet = new TextSnippet()
$snippet->setHighlightTemplate('<strong>%word%</strong>')

// Defaults
$minWords = 30;
$maxWords = 100;

$snippet = new TextSnippet()
$snippet->setMinWords(10);
$snippet->setMaxWords(30);