wongyip/phphelpers 问题修复 & 功能扩展

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

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-22