PHP code example of dawnstar / curse

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

    

dawnstar / curse example snippets


return [

    'providers' => [
        ...
        
        \Curse\Providers\CurseServiceProvider::class,
    ],
    
    
    'aliases' => [
        ...
        
        'Curse' => \Curse\Facades\CurseFacade::class,
    ],
];

//Soft File dosyasının yolunu set etmeyi sağlar
//Dosyaların içindeki kelimeler satır satır ayrılmalıdır.
$curse = Curse::setSoftFile(public_path('soft.txt'));

//Filtrelenecek küfürlerin olduğu dosyaları çekmek için
$hard_file_words = Curse::getHardFile();
$soft_file_words = Curse::getSoftFile();

//Filtrelenecek text'in ve yerine yazılacak text'in set edilmesi,
//init fonksiyonu ile filtreleme gerçekleştirilir. 
//init fonksiyonuna parametre verilerek ("soft" | "hard") istenilen türde filtreleme yapılabilir.
$filtered_text = Curse::setText("Filtrelenmesi istenen text")
        ->setReplacementText("***")
        ->init();