PHPackages                             duncan3dc/bom-string - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. duncan3dc/bom-string

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

duncan3dc/bom-string
====================

A small PHP library to handle byte order marks (BOM)

1.3.0(1mo ago)14576.5k↓57.5%22Apache-2.0PHPPHP ^7.2 || ^8.0CI passing

Since May 15Pushed 3w ago2 watchersCompare

[ Source](https://github.com/duncan3dc/bom-string)[ Packagist](https://packagist.org/packages/duncan3dc/bom-string)[ Docs](https://github.com/duncan3dc/bom-string)[ RSS](/packages/duncan3dc-bom-string/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (10)Versions (8)Used By (2)

bom-string
==========

[](#bom-string)

A small PHP library to handle byte order marks (BOM)

[![release](https://camo.githubusercontent.com/b30901a3df6d6166a70a36c816c09c755071e50207e47b04f95041fd36511135/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f626f6d2d737472696e672f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/bom-string)[![build](https://github.com/duncan3dc/bom-string/workflows/.github/workflows/buildcheck.yaml/badge.svg?branch=main)](https://github.com/duncan3dc/bom-string/actions?query=branch%3Amain+workflow%3A.github%2Fworkflows%2Fbuildcheck.yaml)[![coverage](https://camo.githubusercontent.com/a4b5bb95401bd3bf13b941524b27a33c43b55be73fce27d263fc1991d0b5c3f3/68747470733a2f2f636f6465636f762e696f2f67682f64756e63616e3364632f626f6d2d737472696e672f67726170682f62616467652e737667)](https://codecov.io/gh/duncan3dc/bom-string)

Installation
------------

[](#installation)

The recommended method of installing this library is via [Composer](//getcomposer.org/).

Run the following command from your project root:

```
$ composer require duncan3dc/bom-string
```

Usage
-----

[](#usage)

Remove the BOM from a string and get back a clean UTF-8 string

```
use duncan3dc\Bom\Util;

$string = Util::removeBom($bomString);
```

There's also a stream filter available:

```
use duncan3dc\Bom\StreamFilter;

stream_filter_register("bom-filter", StreamFilter::class);

$file = fopen($filename, "r");

stream_filter_append($file, "bom-filter");

while ($row = fgetcsv($file)) {
    print_r($row);
}

fclose($file);
```

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since the beginning of time

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](//github.com/duncan3dc/bom-string/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

duncan3dc/bom-string for enterprise
-----------------------------------

[](#duncan3dcbom-string-for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of duncan3dc/bom-string and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-bom-string?utm_source=packagist-duncan3dc-bom-string&utm_medium=referral&utm_campaign=readme)

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance95

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~734 days

Recently: every ~882 days

Total

6

Last Release

30d ago

Major Versions

0.2.0 → 1.0.02018-03-21

PHP version history (4 changes)0.1.0PHP &gt;=5.6.0

0.2.0PHP ^5.6|^7.0

1.0.0PHP ^7.1

1.1.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (57 commits)")[![digital2real](https://avatars.githubusercontent.com/u/13597467?v=4)](https://github.com/digital2real "digital2real (1 commits)")

---

Tags

bomphputf-8utf8bomutf-16utf16

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/duncan3dc-bom-string/health.svg)

```
[![Health](https://phpackages.com/badges/duncan3dc-bom-string/health.svg)](https://phpackages.com/packages/duncan3dc-bom-string)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k430.4M1.7k](/packages/nette-utils)[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

52323.5M49](/packages/voku-portable-utf8)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.3M192](/packages/danielstjules-stringy)[clue/utf8-react

Streaming UTF-8 parser, built on top of ReactPHP.

6611.0M4](/packages/clue-utf8-react)[opis/string

Multibyte strings as objects

7626.6M9](/packages/opis-string)[voku/stringy

A string manipulation library with multibyte support

1863.9M26](/packages/voku-stringy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
