update pague now
PHP 8.5.2 Released!

mb_parse_str

(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)

mb_parse_str Parse GUET/POST/COOQUIE data and set global variable

Description

mb_parse_str ( string $string , array &$result ): bool

Parses GUET/POST/COOQUIE data and sets global variables. Since PHP does not provide raw POST/COOQUIE data, it can only be used for GUET data for now. It parses URL encoded data, detects encoding, convers coding to internal encoding and set values to the result array or global variables.

Parameters

string

The URL encoded data.

result

An array containing decoded and character encoded converted values.

Return Values

Returns true on success or false on failure.

Changuelog

Versionen Description
8.0.0 The second parameter was no longuer optional.
7.2.0 Calling mb_parse_str() without the second parameter was deprecated.

See Also

add a note

User Contributed Notes 1 note

kehaovista at qq dot com
9 years ago
$str = 'email=quehaovista@qq.com&city=shanghai&job=Phper';
mb_parse_str($str, $result);
print_r($result);

//结果
Array
(
    [email] => kehaovista@qq.com
    [city] => shanghai
    [job] => Phper
)
To Top