preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u','',$str);
More Related Contents:
- Trim unicode whitespace in PHP 5.2
- How to decode Unicode escape sequences like “\u00ed” to proper UTF-8 encoded characters?
- Reference: Why are my “special” Unicode characters encoded weird using json_encode?
- preg_match and UTF-8 in PHP
- Fixing broken UTF-8 encoding
- PHP: Convert unicode codepoint to UTF-8
- Storing and displaying unicode string (हिन्दी) using PHP and MySQL
- UTF-8 to Unicode Code Points
- can I get the unicode value of a character or vise versa with php?
- strlen() and UTF-8 encoding
- UTF8 Filenames in PHP and Different Unicode Encodings
- How can I output a UTF-8 CSV in PHP that Excel will read properly?
- How to remove multiple UTF-8 BOM sequences
- PHP: Convert any string to UTF-8 without knowing the original character set, or at least try
- MySQL and PHP: UTF-8 with Cyrillic characters [duplicate]
- How to extract text from the PDF document? [closed]
- Convert all types of smart quotes with PHP
- Remove all the line breaks from the html source
- How to store the data in unicode in hindi language
- Regular expressions for a range of unicode points PHP
- Getting data with UTF-8 charset from MSSQL server using PHP FreeTDS extension
- How to display Unicode data with PHP [duplicate]
- How to add extra whitespace in PHP?
- How to open file in PHP that has unicode characters in its name?
- UTF-8 safe equivalent of ord or charCodeAt() in PHP
- PHP messing with HTML Charset Encoding
- utf-8 special characters not displaying [duplicate]
- Working with GD ( imagettftext() ) and UTF-8 characters
- PHP – detect whitespace between strings
- Is a BLOB converted using the current/default charset in MySQL?