PHP code example of axisofstevil / stop-words

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

    

axisofstevil / stop-words example snippets


$filter = new Axisofstevil\StopWords\Filter();
echo $filter->cleanText('A Walk to Remember'); // 'Walk Remember'

$filter->setWords(array('a','walk','to'));
echo $filter->cleanText('A Walk to Remember'); // 'Remember'

$filter->mergeWords(array('remember'));
echo $filter->cleanText('A Walk to Remember'); // ''