¡@

Home 

php Programming Glossary: x80

Regex to detect Invalid UTF-8 String

http://stackoverflow.com/questions/11709410/regex-to-detect-invalid-utf-8-string

# Invalid UTF 8 Bytes xF5 xFF # Invalid UTF 8 Bytes xE0 x80 x9F # Overlong encoding of prior code point xF0 x80 x8F # Overlong.. xE0 x80 x9F # Overlong encoding of prior code point xF0 x80 x8F # Overlong encoding of prior code point xC2 xDF x80 xBF.. x80 x8F # Overlong encoding of prior code point xC2 xDF x80 xBF # Invalid UTF 8 Sequence Start xE0 xEF x80 xBF 2 # Invalid..

PHP: How to remove all non printable characters in a string?

http://stackoverflow.com/questions/1176904/php-how-to-remove-all-non-printable-characters-in-a-string

like this should do it string preg_replace ' x00 x1F x80 xFF ' '' string It matches anything in range 0 31 128 255 and..

PHP: Truncate HTML, ignoring tags

http://stackoverflow.com/questions/1193500/php-truncate-html-ignoring-tags

sequences as one character. re isUtf8 ' a z ^ # a zA Z0 9 x80 xFF x80 xBF ' ' a z ^ # a zA Z0 9 ' while printedLength maxLength.. as one character. re isUtf8 ' a z ^ # a zA Z0 9 x80 xFF x80 xBF ' ' a z ^ # a zA Z0 9 ' while printedLength maxLength preg_match.. str if printedLength maxLength break if tag 0 ' ' ord tag 0x80 Pass the entity or UTF 8 multibyte sequence through unchanged...

Remove non-utf8 characters from string

http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string

'END' x00 x7F # single byte sequences 0xxxxxxx xC0 xDF x80 xBF # double byte sequences 110xxxxx 10xxxxxx xE0 xEF x80 xBF.. x80 xBF # double byte sequences 110xxxxx 10xxxxxx xE0 xEF x80 xBF 2 # triple byte sequences 1110xxxx 10xxxxxx 2 xF0 xF7 x80.. xBF 2 # triple byte sequences 1110xxxx 10xxxxxx 2 xF0 xF7 x80 xBF 3 # quadruple byte sequence 11110xxx 10xxxxxx 3 1 100 #..

Remove accents without using iconv

http://stackoverflow.com/questions/3542818/remove-accents-without-using-iconv

str length strlen str for i 0 i length i c ord str i if c 0x80 n 0 # 0bbbbbbb elseif c 0xE0 0xC0 n 1 # 110bbbbb elseif c 0xF0.. bytes matching 10bbbbbb follow if i length ord str i 0xC0 0x80 return false return true Converts all accent characters to.. characters. function remove_accents string if preg_match ' x80 xff ' string return string if seems_utf8 string chars array..

Remove diacritics from a string

http://stackoverflow.com/questions/3635511/remove-diacritics-from-a-string

str length strlen str for i 0 i length i c ord str i if c 0x80 n 0 # 0bbbbbbb elseif c 0xE0 0xC0 n 1 # 110bbbbb elseif c 0xF0.. bytes matching 10bbbbbb follow if i length ord str i 0xC0 0x80 return false return true Converts all accent characters to.. characters. function remove_accents string if preg_match ' x80 xff ' string return string if seems_utf8 string chars array..