PHP mb_parse_str() Function Last Updated : 11 Apr, 2023 Comments Improve Suggest changes Like Article Like Report The mb_parse_str() is an inbuilt function in PHP that is used to parse a string into variables. It is very similar to parse_str(). But it operates multibyte characters. Syntax: mb_parse_str($string, $result): boolParameters: This function accepts two parameters that are described below. $string: Input query string parsed to in this parameter.$result: This is the array parameter that holds the result in the form of decoded and encoded character values that are transformed.Return Values: This function returns "true" if the function executes successfully otherwise it will return "false". Example 1: The following program demonstrates the mb_parse_str() function. PHP <?php $query = "book=harry+potter&author=Jk+Rowling&year=1997"; $result = array(); mb_parse_str($query, $result); print_r($result); ?> Output: Array ( [book] => harry potter [author] => Jk Rowling [year] => 1997 ) Example 2: The following program demonstrates the mb_parse_str() function. PHP <?php $query = "fruits=apple%2Cbanana%2Ckiwi&vegetables=tomato%2Ccarrot%2Cspinach&drinks=water%2Cjuice%2Csoda"; $result = array(); mb_parse_str($query, $result); print_r($result); ?> Output: Array ( [fruits] => apple,banana,kiwi [vegetables] => tomato,carrot,spinach [drinks] => water,juice,soda ) Reference: https://www.php.net/manual/en/function.mb-parse-str.php Comment More infoAdvertise with us Next Article PHP mb_parse_str() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-Multibyte-String Similar Reads PHP | parse_url() Function The parse_url() function is an inbuilt function in PHP which is used to return the components of a URL by parsing it. It parses an URL and return an associative array which contains its various components. Syntax: parse_url( $url, $component = -1 ) Parameters: This function accepts two parameters as 2 min read PHP mb_strstr() Function The mb_strstr() function is an inbuilt function in PHP that finds the first occurrence of a given string in the main string, i.e. it will search for the occurrence of the first needle in haystack, & id found then the portion of the haystack will be returned, otherwise return false. Syntax: mb_st 2 min read PHP mb_strpos() Function The mb_strpos() function is an inbuilt function in PHP that finds the position of string occurrence in the string. Syntax: mb_strpos( $haystack, $needle, $offset, $encoding ): int|falseParameters: This function accepts 4 parameters that are described below: $haystack: This parameter is the main stri 2 min read PHP | xml_parse() Function The xml_parse() function is an inbuilt function in PHP which is used to parse XML document. Syntax:Â int xml_parse( resource $xml_parser, string $xml_data, bool $is_final ) Parameter: This function accepts three parameters as mentioned above and described below:Â Â $xml_parser: It is required paramet 3 min read PHP mb_strlen() Function The mb_strlen() is an inbuilt PHP function that returns the string length in an integer. Syntax: mb_strlen($string, $encoding ): intParameters: This function accepts 2 parameters that are described below: $string: The string parameter whose lengths need to be determined. It is a required parameter.$ 1 min read Like