PHP utf8_encode() Function

Description

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

Syntax

PHP utf8_encode() Function has the following syntax.

utf8_encode(string)

Parameter

Parameter Is Required Description
string Required. String to encode

Return

This function returns the encoded string on success, or FALSE on failure.

Example


<?PHP
echo utf8_encode("from java2s.com");
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions