Tag Archives | mbstring

PHP function: mb_ucwords – Uppercase the first character of each word in a string

Currently on PHP does not have a multibyte (UTF-8) version of ucwords function. I wrote some multibyte mb_ucwords function: You must call these functions before: Method 1: Method 2: Example: Result:

Read full story Comments { 0 }

PHP function: mb_ucfirst

Currently on PHP does not have a multibyte (UTF-8) version of ucfirst function. I wrote some multibyte mb_ucfirst function: You must call these functions before: Method 1: Method 2: Method 3: Method 4: Method 5: New update 12/02/2015 Example: Result: How to make a string’s first character Uppercase-Multibyte?

Read full story Comments { 0 }
PHP: convert javascript escape string to UTF8

PHP: convert javascript escape string to UTF8

Read first: PHP: PHP: Convert Numeric Character Reference to UTF8 Example 1: U+0621: ARABIC LETTER HAMZA Java Escape: “\u0621” Javascript Escape: “\u0621” result: ء We can create this function below: Example 2: result: สารานุกรมเสรี Alternative function:

Read full story Comments { 0 }
PHP: function mb_str_split

PHP: function mb_str_split

mbstring provides multibyte specific string functions that help you deal with multibyte encodings in PHP. In addition to that, mbstring handles character encoding conversion between the possible encoding pairs. mbstring is designed to handle Unicode-based encodings such as UTF-8 and UCS-2 and many single-byte encodings for convenience.

Read full story Comments { 0 }