PHP iconv Functions

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

About This Index

This page is the PHP iconv Functions index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.

Learn how character sets and conversion work on /php/iconv. Use this page when you need a specific helper such as iconv(), iconv_strlen(), or iconv_mime_decode().

Beginner path.

Start with iconv(), then try iconv_strlen() and iconv_substr().

How to Call a iconv Function

iconv helpers are global functions—pass the text and, where you can, the encoding name:

PHP
<?php
$utf8   = iconv("ISO-8859-1", "UTF-8", $latin1);
$length = iconv_strlen($utf8, "UTF-8");
$part   = iconv_substr($utf8, 0, 3, "UTF-8");
$pos    = iconv_strpos($utf8, "x", 0, "UTF-8");

PHP iconv Functions Table

All function guides in this PHP tutorial series (11 tutorials in 4 categories).

Convert

2 functions

Change text from one character set to another, or convert a whole output buffer.

FunctionDescriptionTutorial
iconv()Converts a string from one character set to another.Try it
ob_iconv_handler()Converts the output buffer to another character set.Try it

Settings

2 functions

Read or change the iconv encoding settings.

FunctionDescriptionTutorial
iconv_get_encoding()Reads the current iconv character set settings.Try it
iconv_set_encoding()Changes an iconv character set setting (deprecated).Try it

String tools

4 functions

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

FunctionDescriptionTutorial
iconv_strlen()Counts the characters in a string, not the bytes.Try it
iconv_substr()Returns part of a string by character position.Try it
iconv_strpos()Finds the character position of the first match in a string.Try it
iconv_strrpos()Finds the character position of the last match in a string.Try it

MIME headers

3 functions

Encode and decode email header fields.

FunctionDescriptionTutorial
iconv_mime_encode()Builds a MIME header field with an encoded value.Try it
iconv_mime_decode()Decodes one MIME header field into readable text.Try it
iconv_mime_decode_headers()Decodes a block of MIME headers into an array.Try it

Frequently Asked Questions

They are the functions of the iconv extension. They convert text between character sets, count and cut by character, and encode or decode email headers.
The iconv page teaches the ideas. This index lists every function tutorial so you can open iconv(), iconv_strlen() and the rest.
Start with iconv(). It does the main job of converting a string from one encoding to another.
They are deprecated since PHP 5.6. Use default_charset and pass the encoding to each function.
If you are new, read PHP iconv first. Then open iconv(), iconv_strlen() and iconv_substr() from the tables below.

Start with iconv()

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

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