utf8_encode() function encodes an iso-8859-1 string into utf-8.
utf8_encode(string);
*/
$str="Hello, world!"; //Define string
$result=utf8_decode($str); //Convert encoding
echo $result; //Output the conversion result
//Example 2
/*
The utf8_decode() function decodes a utf-8 string into iso-8859-1.
This function converts an iso-8859-1 string encoded in utf-8 into a single-byte iso-8859-1 string.
If successful, this function returns the decoded string; otherwise it returns false.
utf8_decode(string)
*/
$str="hello world!"; //Define string
$result=utf8_decode($str); //Convert encoding
echo $result;
$result=utf8_encode($result); //Convert encoding
echo $result; //Output the conversion result
?>