PHP | utf8_decode() Function Last Updated : 06 Jan, 2023 Comments Improve Suggest changes Like Article Like Report The utf8_decode() function is an inbuilt function in PHP which is used to decode a UTF-8 string to the ISO-8859-1. This function decodes back to the encoded string which is encoded with the utf8_encode() function. Syntax: string utf8_decode( string $string ) Parameter: This function accepts single parameter $string which is required. It specifies the UTF-8 encoded string to be decoded. Return Value: This function returns a string representing the decoded string on success and false on failure. Note: This function is available for PHP 4.0.0 and newer version. Program 1: PHP <?php // String to decode $string_to_decode = "\x63"; // Encoding string echo utf8_encode($string_to_encode) ."<br>"; // Encoding string echo utf8_decode($string_to_decode); ?> Output: c c Program 2: PHP <?php // Creating an array of 256 elements $text = array( "\x20", "\x21", "\x22", "\x23", "\x24", "\x25", "\x26", "\x27", "\x28", "\x29", "\x2a", "\x2b", "\x2c", "\x2d", "\x2e", "\x2f", "\x30", "\x31" ); echo "Encoded elements:\n"; // Encoding and decoding all elements foreach( $text as $index ) { echo utf8_encode($index) . " "; } echo "\nDecoded elements:\n"; foreach( $text as $index ) { echo utf8_decode($index) . " "; } ?> Output: Encoded elements: ! " # $ % & ' ( ) * + , - . / 0 1 Decoded elements: ! " # $ % & ' ( ) * + , - . / 0 1 Reference: https://www.php.net/manual/en/function.utf8-decode.php Comment More infoAdvertise with us Next Article PHP | utf8_decode() Function G gekcho Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | json_decode() Function The json_decode() function is an inbuilt function in PHP which is used to decode a JSON string. It converts a JSON encoded string into a PHP variable. Syntax: json_decode( $json, $assoc = FALSE, $depth = 512, $options = 0 ) Parameters: This function accepts four parameters as mentioned above and des 2 min read PHP decoct( ) Function In the earlier days of computing, octal numbers and the octal numbering system was very popular for counting inputs and outputs because as it works in counts of eight, inputs and outputs were in counts of eight, a byte at a time. Due to a wide usage of octal number system many times it happens that 2 min read PHP | base64_decode() Function The base64_decode() is an inbuilt function in PHP which is used to Decodes data which is encoded in MIME base64.Syntax: string base64_decode( $data, $strict ) Parameters: This function accepts two parameter as mentioned above and described below: $data: It is mandatory parameter which contains the e 1 min read PHP | json_encode() Function The json_encode() function is an inbuilt function in PHP which is used to convert PHP array or object into JSON representation. Syntax : string json_encode( $value, $option, $depth ) Parameters: $value: It is a mandatory parameter which defines the value to be encoded. $option: It is optional parame 2 min read PHP | base64_encode() Function The base64_encode() function is an inbuilt function in PHP that is used to encode data with MIME base64. MIME (Multipurpose Internet Mail Extensions) base64 is used to encode the string in base64. The base64_encoded data takes 33% more space than the original data. Syntax: string base64_encode( $dat 1 min read PHP | ctype_xdigit() Function The ctype_xdigit() function in PHP used to check each and every character of string/text are hexadecimal digit or not. It return TRUE if all characters are hexadecimal otherwise return FALSE . Syntax : ctype_xdigit(string text) Parameters Used: text : It is mandatory parameter which specifies the te 2 min read PHP mb_decode_mimeheader() Function The mb_decode_mimeheader() function is an inbuilt function in PHP where the string is decoded into the MIME header field. Syntax: mb_decode_mimeheader(string $string): string Parameter: This function has a single parameter: string: This parameter specifies the string that is to be decoded. Return Va 1 min read PHP mb_detect_encoding() Function The mb_detect_encoding() is an inbuilt function in PHP that is used to detect the encoding of the string. Syntax: string|false mb_detect_encoding( string $string, array|string|null $encodings = null, bool $strict = false ) Parameters: This function accepts three parameters that are described below. 2 min read PHP mb_chr() Function The mb_chr() function is an inbuilt function in PHP that is used to return the character unicode point value that is encoded into the specified encoding. Syntax: string|false mb_chr(int $codepoint, string $encoding = null) Parameters: This function accepts two parameters that are described below: $c 1 min read PHP | convert_cyr_string() Function The convert_cyr_string() function is a inbuilt function in PHP. The function is used to convert a string from one Cyrillic character-set to another. Here two arguments are used such as from and to and they are of single character which represent the source and destination of Cyrillic character sets. 2 min read Like