There is a special syntax for the trim function from php.net/trim , which allows you to specify the range that, according to the translator, is because of ".."
// trim the ASCII control characters at the beginning and end of $binary // (from 0 to 31 inclusive) $clean = trim($binary, "\x00..\x1F"); var_dump($clean);
The second argument to trim should be a string of characters that would be stripped out, so you won't need to put '.' twice.
source share