mb_substr

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′);

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.