private static function isPrintable($str)
    {
        for ($i = 0; $i < strlen($str); $i++) {
            if (!($str[$i] >= ' ' && $str[$i] <= '~')) {
                return false;
            }
        }
        return true;
    }
private static function isPrintable($str)
    {
        for ($i = 0; $i < strlen($str); $i++) {
            if (!($str[$i] >= ' ' && $str[$i] <= '~')) {
                return false;
            }
        }
        return true;
    }
private static function isPrintable ( $ str ) { for ( $ i = 0 ; $ i < strlen ( $ str ) ; $ i ++ ) { if ( ! ( $ str [ $ i ] >= ' ' && $ str [ $ i ] <= '~' ) ) { return false ; } } return true ; }
Determines whether the string contains only printable characters.

@param string $str string to test.
@return bool returns true if string is printable.
Determines whether the string contains only printable characters .