PHP iconv Functions

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().
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
$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 functionsChange text from one character set to another, or convert a whole output buffer.
| Function | Description | Tutorial |
|---|---|---|
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 functionsRead or change the iconv encoding settings.
| Function | Description | Tutorial |
|---|---|---|
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 functionsCount, search and cut text by character instead of by byte.
| Function | Description | Tutorial |
|---|---|---|
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 functionsEncode and decode email header fields.
| Function | Description | Tutorial |
|---|---|---|
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
Start with iconv()
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
