fab2s/bom 问题修复 & 功能扩展

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

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

fab2s/bom

最新稳定版本:1.0.1

Composer 安装命令:

composer require fab2s/bom

包简介

Purely static zero dependencies BOM Helper to handle unicode BOMs

README 文档

README

Build Status Total Downloads Monthly Downloads Latest Stable Version Scrutinizer Code Quality PRs Welcome License

A purely static zero dependencies byte Order Mark Helper to handle unicode BOMs

Installation

Bom can be installed using composer:

composer require "fab2s/bom"

Bom is also included in OpinHelper which packages several bellow "Swiss Army Knife" level Helpers covering some of the most annoying aspects of php programing, such as UTF8 string manipulation, high precision Mathematics or properly locking a file

Should you need to work with php bellow 7.1, you can still use OpinHelper 0.x

Prerequisites

Bom has no specific dependencies

In practice

Bom supports UTF-8|16|32 BOMs in both Little and Big Endianness

Bom is minimalistic, it only exposes five methods

// get Bom
$bomAtStartOfString = Bom::extract($string); // returns null when none are found

// remove eventual BOM from beging of string
$bomLessString = Bom::drop($string);

// get encoding from a supported BOM
$encoding = Bom::getBomEncoding($bom); // returns null if the BOM is not valid

// get BOM for a supported encoding
$bom = Bom::getEncodingBom($encoding); // returns null if the encoding is not supported (has no BOM)

// get the list of BOMs as an array with corresponding encodings as indexes
$boms = Bom::getBoms(); // returns an associatiove array of encodings and correesponding BOMs

foreach ($boms as $encoding => $bom) {
    // do something ...
}

Requirements

Bom is tested against php 7.1, 7.2, 7.3, 7.4 and 8.0

Contributing

Contributions are welcome, do not hesitate to open issues and submit pull requests.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固