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)
Installs: 2 082
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 2
Requires
- php: >=5.3
This package is auto-updated.
Last update: 2024-12-06 09:38:21 UTC
README
^B A dead-simple PHP library to add caret notation in order to safely show strings that contain ASCII control characters (unprintable characters)
Quickstart example
Once installed, 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
The recommended way to install this library is through composer. New to composer?
{ "require": { "clue/caret-notation": "~0.2.0" } }
License
MIT