villermen/data-handling

Library for general data sanitization and validation.

Maintainers

Package info

github.com/villermen/data-handling

pkg:composer/villermen/data-handling

Statistics

Installs: 229

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

v2.1.0 2026-06-28 02:24 UTC

This package is auto-updated.

Last update: 2026-06-28 21:39:17 UTC


README

PHP library with general data sanitization and formatting utilities. Contains utility methods not otherwise contained in framework components that I see myself needing at times. My "functions.php", if you will.

Examples

Clean::text('<p>dirty &emdash; nasty<br>html</p>'); // "dirty — nasty html"
Clean::text('<p>dirty &emdash; nasty<br>html</p>', ['br']); // "dirty — nasty<br>html"
Clean::alphanumeric('proteïne shake'); // "proteineshake"
Clean::alphanumeric('proteïne shake', ' '); // "proteine shake"
Clean::slug('ßÈÿ žÐ-'); // "ssey-zdj"
Clean::digits("1 abc 23\n4") // "1234"

Path::format('/././//.///path//to\\file'); // "/path/to/file"
Path::merge('/root/directory', '/relative/path'); // "/root/directory/relative/path"
Path::makeRelative('/root/directory', '/root/directory/relative/path') // "relative/path"
Path::formatFilesize(1436549120); // "1.34 GiB"

Filter::match('file23.txt', 'file*.txt') // true

Installation

composer require villermen/data-handling