PHP mb_substitute_character() Function Last Updated : 07 May, 2023 Comments Improve Suggest changes Like Article Like Report The mb_substitute_character() is an inbuilt function in PHP that sets or retrieves the substitution character used when a multi-byte string cannot be represented in the specified character encoding. Syntax: mb_substitute_character($substitute_character ): string|int|boolParameters: This function accepts only one parameter which is described below. $substitute_character: This parameter is used to specify the Unicode value in the form of an integer, long, character entity, or none in the case when there is no output.Return Value: If the substitution character is set, it will return "true" otherwise it will return "false". If the substitution character is not, it will return the default setting. Example 1: The following program demonstrates the mb_substitute_character() function. PHP <?php $subchar = mb_substitute_character(); echo "Current substitution character: $subchar"; ?> Output: Current substitution character: 63 Example 2: The following program demonstrates the mb_substitute_character() function. PHP <?php echo "The subtitution character = ".mb_substitute_character('long'); ?> Output: The subtitution character = 1 Reference: https://www.php.net/manual/en/function.mb-substitute-character.php Comment More infoAdvertise with us Next Article PHP mb_substitute_character() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-Multibyte-String Similar Reads 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 mb_strtoupper() Function The mb_strtoupper() function is an inbuilt function in PHP that helps to transform the multibyte string to uppercase. Syntax: mb_strtoupper(string $string, ?string $encoding = null): string Parameters: This function has two parameters: string: This parameter specifies the string that is to be made t 1 min read PHP mb_scrub() Function The mb_scrub() is an inbuilt PHP function that replaces an invalid character set to the substitute character. If the encoding is not provided. It will use default encoding. Syntax: mb_scrub($string, $encoding ); Parameters: This function accepts two parameters that are described below. $string: The 1 min read PHP mb_ereg_replace_callback() Function The mb_ereg_replace_callback() function is an inbuilt function in PHP that is used to replace a regular expression match in a string using the callback function. Syntax: mb_ereg_replace_callback( $pattern, $callback,$string,$options): string|false|null Parameters: The function accepts four parameter 2 min read PHP substr() function The substr() is a built-in function in PHP that is used to extract a part of string. Syntax: substr(string_name, start_position, string_length_to_cut) Parameters: The substr() function allows 3 parameters or arguments out of which two are mandatory and one is optional. string_name: In this parameter 2 min read Like