![]() |
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.
Return value: The mb_scrub() function returns the string which is replaced with an invalid byte sequence Program 1: The following program demonstrates the mb_scrub() function. In the below program. The string is already valid so the string returned as it is. PHP
Output
Hello World! Program 2: The following program demonstrates the mb_scrub() function.In the below program. The string is not valid so this function changes the string according to the default encoding. PHP
Output
Héllo W?rld! Reference: https://www.php.net/manual/en/function.mb-scrub.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |