Probably write your own, I don't know of any, though I'm sure some exist. If you know exactly which formatting marks you want to look for you could simply str_replace those with their hex equivalent. If you want to be able to view all characters as their hex values, you could iterate through the string like this:
- $str = "test";
-
-
for($i = 0; $i < strlen($str); $i++) {
-
echo str_pad(dechex(ord($str[$i])), 2, "0", STR_PAD_LEFT)." ";
-
}
This outputs:
74 65 73 74
The hex equivalent of the string "test".
First you're getting the decimal (ASCII) value of the character, then you're getting the hex value from the decimal value, and just for safety, padding the string to a length of 2 with a "0" character, since, for example, a decimal value of 5 will display as 5 in PHP, but it's actual hex value is 05. The padding is just in case there are any characters whose decimal value is less than or equal to 16 (which is 0F in hex).
Edit: Also, if you want, you can wrap that in strtoupper(). This isn't really necessary, since the hex byt 0f is the same as 0F, but it just adds a uniformity.