nhpiash/php-input-filter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

nhpiash/php-input-filter

最新稳定版本:v1.0.0

Composer 安装命令:

composer require nhpiash/php-input-filter

包简介

A lightweight and reusable PHP package to sanitize and validate user inputs like strings, integers, emails, URLs, booleans, and arrays.

README 文档

README

A lightweight, reusable PHP packagez for sanitizing and validating user inputs. Designed to prevent XSS, malformed inputs, and improve form data consistency.

📌 Features

  • Sanitize and validate:
    • Strings
    • Integers
    • Emails
    • URLs
    • Booleans
    • Arrays
  • Centralized input handling
  • PSR-4 autoloading (Composer ready)
  • No framework dependency

🚀 Installation

You can use Composer to install this package:

composer require nhpiash/php-input-filter

Or include manually:

require 'src/InputFilter.php'

✨ Usage

use Nhpiash\InputFilter\InputFilter;

$name     = InputFilter::getString($_POST['name']);
$age      = InputFilter::getInt($_POST['age']);
$email    = InputFilter::getEmail($_POST['email']);
$website  = InputFilter::getSanitizedURL($_POST['website']);
$agreed   = InputFilter::getBoolean($_POST['terms']);
$filtered = InputFilter::getFilteredArray($_POST, 'string');

📂 Project Structure

php-input-filter/
├── vendor/                  ← Composer autoloading
│   └── autoload.php
├── src/
│   └── InputFilter.php      ← Core Library
├── examples/
│   ├── form.php             ← Bootstrap Example Form
│   └── validate-form.php    ← Input Handling Example
├── README.md
├── documentation.txt
├── composer.json
└── composer.lock

🙌 Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check the issues page if you'd like to collaborate.

📄 License

This project is open source and available under the MIT License.

📬 Contact

If you like this project or have any questions, feel free to reach out!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-17