PHP mbstring Functions

About This Index
This page is the PHP mbstring Functions index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs. It covers a beginner set of the most useful mb_* functions.
Learn how multibyte text works on /php/mbstring. Use this page when you need a specific helper such as mb_strlen(), mb_substr(), or mb_convert_encoding().
Start with mb_strlen(), mb_substr() and mb_convert_encoding().
How to Call a mbstring Function
mbstring helpers are global functions—pass the text and, where you can, the encoding name:
<?php
$length = mb_strlen($text, "UTF-8");
$part = mb_substr($text, 0, 5, "UTF-8");
$lower = mb_strtolower($text, "UTF-8");
$utf8 = mb_convert_encoding($old, "UTF-8", "ISO-8859-1"); PHP mbstring Functions Table
All function guides in this PHP tutorial series (10 tutorials in 4 categories).
Length & position
3 functionsCount, find and cut text by character instead of by byte.
| Function | Description | Tutorial |
|---|---|---|
mb_strlen() | Counts the characters in a string, not the bytes. | Try it |
mb_strpos() | Finds the character position of the first match in a string. | Try it |
mb_substr() | Returns part of a string by character position. | Try it |
Letter case
2 functionsChange text to lowercase or uppercase in any script.
| Function | Description | Tutorial |
|---|---|---|
mb_strtolower() | Makes a string lowercase, including accented letters. | Try it |
mb_strtoupper() | Makes a string uppercase, including accented letters. | Try it |
Encoding
3 functionsCheck, detect and convert character encodings.
| Function | Description | Tutorial |
|---|---|---|
mb_check_encoding() | Checks whether a string is valid in a given encoding. | Try it |
mb_convert_encoding() | Converts a string from one character encoding to another. | Try it |
mb_detect_encoding() | Guesses the character encoding of a string. | Try it |
Settings & info
2 functionsRead the default encoding and see which encodings are supported.
| Function | Description | Tutorial |
|---|---|---|
mb_internal_encoding() | Gets or sets the default encoding for mbstring functions. | Try it |
mb_list_encodings() | Returns a list of the encodings mbstring supports. | Try it |
Frequently Asked Questions
Start with mb_check_encoding()
Open the first guide—syntax, examples, and FAQs.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
15 people found this page helpful
