PHP utf8_encode() Function

❮ PHP XML Parser Reference

Example

Encode an ISO-8859-1 string to UTF-8:

<?php
$text = "\xE0";
echo utf8_encode($text);
?>
Try it Yourself »

Definition and Usage

The utf8_encode() function encodes an ISO-8859-1 string to UTF-8.

Unicode is a universal standard, and has been developed to describe all possible characters of all languages plus a lot of symbols with one unique number for each character/symbol.

However, it is not always possible to transfer a Unicode character to another computer reliably. UTF-8 has been developed to transfer a Unicode character from one computer to another.

Syntax

utf8_encode(string)

Parameter Values

Parameter Description
string Required. Specifies the ISO-8859-1 string to encode

Technical Details

Return Value: The encoded string on success. FALSE on failure
PHP Version: 4.0+

❮ PHP XML Parser Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.