Skip to content

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

License

Notifications You must be signed in to change notification settings

clue/php-caret-notation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clue/caret-notation Build Status

^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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages