wongyip/phphelpers
最新稳定版本:v0.5.5
Composer 安装命令:
composer require wongyip/phphelpers
包简介
Useful PHP classes.
README 文档
README
A collection of utility PHP classes designed for everyday development tasks. This library provides convenient static methods for formatting and converting various data types.
Classes
Format
A comprehensive formatting utility class with support for:
- Array formatting - Convert arrays to text, flatten nested structures
- DateTime formatting - Predefined formats for MySQL, JavaScript, Outlook, and more
- File size formatting - Human-readable file sizes with binary/metric prefixes
- String formatting - Case conversions (camel, kebab, snake, studly), smart capitalization
- Date interval formatting - Human-readable time periods
Other Classes
- ICAL - Generate standardized ICAL format calendars
- Convert - Data conversion utilities
- CSS - CSS-related helpers
- IPv4 - IPv4 address utilities
Deprecated
- DT & DTFormat - Additional date/time utilities
Quick Start
use Wongyip\PHPHelpers\Format; // Format file sizes echo Format::fileSize(1536); // "1.5 KB" // Format dates echo Format::MySQL(); // "2023-12-25 15:30:45" // Convert strings echo Format::camel('hello-world'); // "helloWorld" // Format arrays to text $data = ['name' => 'John', 'age' => 30]; echo Format::toText($data); // name: John // age : 30
Documentation
Installation
composer require wongyip/phphelpers
Requirements
- PHP 8.0 or higher
统计信息
- 总下载量: 2.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-22