The utf8_encode() function encodes an ISO-8859-1 string to UTF-8.
PHP utf8_encode() Function has the following syntax.
utf8_encode(string)
Parameter | Is Required | Description |
---|---|---|
string | Required. | String to encode |
This function returns the encoded string on success, or FALSE on failure.
<?PHP
echo utf8_encode("from java2s.com");
?>
The code above generates the following result.