mb_substr
- It is used to get part of string
- mb_substr performs multi-byte safe substr() operation
Parameters
string mb_substr ( string str, int start [, int length [, string encoding]])
1. Str - String to find the substring
2. start - Starting position of sub-string
3. Length - Length of sub-string to return
4. encoding - encoding
- Encoding parametr is optional, if we didn’t specify that php will automatically take internal encoding.
Example:
$str = “Test Test”;
echo mb_substr ( $str, 0 , 4, ‘UTF-8′);
