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.2.0(1y ago)14538.1k↓29.5%22Apache-2.0PHPPHP ^7.2 || ^8.0

Since May 15Pushed 1y 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 1mo ago

READMEChangelogDependencies (5)Versions (6)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.yml/badge.svg?branch=main)](https://github.com/duncan3dc/bom-string/actions?query=branch%3Amain+workflow%3A.github%2Fworkflows%2Fbuildcheck.yml)[![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

45

—

FairBetter than 93% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~741 days

Total

5

Last Release

691d 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 (52 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.1k394.3M1.5k](/packages/nette-utils)[voku/portable-utf8

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

52322.4M40](/packages/voku-portable-utf8)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)[opis/string

Multibyte strings as objects

7420.9M7](/packages/opis-string)[cyclonedx/cyclonedx-php-composer

Creates CycloneDX Software Bill-of-Materials (SBOM) from PHP Composer projects

821.6M17](/packages/cyclonedx-cyclonedx-php-composer)

PHPackages © 2026

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