PHPackages                             clue/caret-notation - 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. clue/caret-notation

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

clue/caret-notation
===================

^B A dead-simple PHP library to add caret notation in order to safely show strings that contain ASCII control characters (unprintable characters)

v0.2.0(11y ago)26.2k↑64.3%1[2 issues](https://github.com/clue/php-caret-notation/issues)1MITPHPPHP &gt;=5.3

Since Jun 19Pushed 11y ago3 watchersCompare

[ Source](https://github.com/clue/php-caret-notation)[ Packagist](https://packagist.org/packages/clue/caret-notation)[ Docs](https://github.com/clue/php-caret-notation)[ RSS](/packages/clue-caret-notation/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (3)Used By (1)

clue/caret-notation [![Build Status](https://camo.githubusercontent.com/cd03d1c0843a328c4774db5ef88d20d473522c233e1e015513a0e102de2b90eb/68747470733a2f2f7472617669732d63692e6f72672f636c75652f7068702d63617265742d6e6f746174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/clue/php-caret-notation)
========================================================================================================================================================================================================================================================================================================================

[](#cluecaret-notation-)

^B A dead-simple PHP library to add [caret notation](https://en.wikipedia.org/wiki/Caret_notation)in order to safely show strings that contain [ASCII control characters](https://en.wikipedia.org/wiki/Control_character#In_ASCII)(unprintable characters)

Quickstart example
------------------

[](#quickstart-example)

Once [installed](#install), you can use the following code to use caret notation for any string that (may possibly) contain binary control characters:

```
$encoder = new Encoder();

$string = "Hello\r\nworld\0";
// Output: Hello^M^Jworld^@
echo $encoder->encode($string);

$string = "No control chars";
// Output: No control chars
echo $encoder->encode($string);
```

Install
-------

[](#install)

The recommended way to install this library is [through composer](http://getcomposer.org). [New to composer?](http://getcomposer.org/doc/00-intro.md)

```
{
    "require": {
        "clue/caret-notation": "~0.2.0"
    }
}
```

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

4032d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/776829?v=4)[Christian Lück](/maintainers/clue)[@clue](https://github.com/clue)

---

Top Contributors

[![clue](https://avatars.githubusercontent.com/u/776829?v=4)](https://github.com/clue "clue (5 commits)")

---

Tags

encodingasciibinaryhexdumpcontrol characterscaret notation

### Embed Badge

![Health badge](/badges/clue-caret-notation/health.svg)

```
[![Health](https://phpackages.com/badges/clue-caret-notation/health.svg)](https://phpackages.com/packages/clue-caret-notation)
```

###  Alternatives

[paragonie/constant_time_encoding

Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)

908363.2M190](/packages/paragonie-constant-time-encoding)[voku/portable-ascii

Portable ASCII library - performance optimized (ascii) string functions for php.

576437.1M171](/packages/voku-portable-ascii)[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6758.1M80](/packages/jbroadway-urlify)[ausi/slug-generator

Slug Generator

8022.4M27](/packages/ausi-slug-generator)[alchemy/binary-driver

A set of tools to build binary drivers

19511.1M40](/packages/alchemy-binary-driver)[paquettg/string-encode

Facilitating the process of altering string encoding in PHP.

699.1M43](/packages/paquettg-string-encode)

PHPackages © 2026

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