承接 kamu/aman 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kamu/aman

最新稳定版本:v1.5.1

Composer 安装命令:

composer require kamu/aman

包简介

Replace badword

README 文档

README

aman

PHP Programming Language Total Downloads views Repo size License

🤬 Simple Profanity Filter

This is a simple project that filters out profane words using regex in PHP. It provides functions to check, get, mask, and remove unwanted words from a text using regex patterns that account for similar characters.

📦 Installation

  1. Run the following command in your project directory:

    composer require kamu/aman
  2. How to Add Blocklist or Allowlist Words

    // Add words to the blocklist
    Aman::extend(['oke', 'safe']);
    
    // Add words to the whitelist
    Aman::allow(['oke', 'safe']);

🛠️ Usage

  1. Check for Profane Words

    use Kamu\Aman;
    
    $text = "This is an example with bad words.";
    $filter = Aman::factory();
    
    if ($filter->check($text)) {
        echo "This text contains profanity.";
    } else {
        echo "This text is clean.";
    }
  2. Mask Profane Words

    $text = "This is an example with bad words.";
    $maskedText = $filter->masking($text, '*');
    echo $maskedText; // Output: "This is an example with *** ****."
  3. Remove Profane Words

    $text = "This is an example with bad words.";
    $cleanText = $filter->filter($text);
    echo $cleanText; // Output: "This is an example with ."
  4. Get Profane Words from Text

    $text = "This is an example with bad words.";
    $badWords = $filter->words($text);
    print_r($badWords); // Output: ['bad', 'words']

🤝 Contributing

I'm very open to those of you who want to contribute to the Aman!

🐞 Security Vulnerabilities

If you find any security vulnerabilities in this Aman, please email DKL via dewanakretarta29@gmail.com.

📜 License

Aman is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 4.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-26