PHP mbstring Functions

Beginner
6 min read
Updated: Nov 2026
10 function guides
Function index

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().

Beginner path.

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
<?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 functions

Count, find and cut text by character instead of by byte.

FunctionDescriptionTutorial
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 functions

Change text to lowercase or uppercase in any script.

FunctionDescriptionTutorial
mb_strtolower()Makes a string lowercase, including accented letters.Try it
mb_strtoupper()Makes a string uppercase, including accented letters.Try it

Encoding

3 functions

Check, detect and convert character encodings.

FunctionDescriptionTutorial
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 functions

Read the default encoding and see which encodings are supported.

FunctionDescriptionTutorial
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

They are the mb_* functions of the mbstring extension. They work with multibyte text and count, search and cut by character.
The mbstring page teaches the ideas. This index lists every function tutorial so you can open mb_strlen(), mb_substr() and the rest.
No. mbstring has more than 50 functions. This index covers the ten that beginners use most.
Start with mb_strlen(). It shows right away why byte-based functions fail on UTF-8 text.
If you are new, read PHP mbstring first. Then open mb_strlen(), mb_substr() and mb_convert_encoding() from the tables below.

Start with mb_check_encoding()

Open the first guide—syntax, examples, and FAQs.

mb_check_encoding() tutorial →

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.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

15 people found this page helpful