English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The parse_str() function is used to parse strings into multiple variables.
void parse_str ( string $str[, array &$arr ] )
It is used to parse a string into variables, if str is the query string passed in by URL, then it parses it into variables and sets it to the current scope (if arr is provided, it will be set to the array).
No value returned
Serial Number | Parameters and Description |
---|---|
1 | str Input String |
2 | array If the second variable arr is set, the array will store the elements in the form of array elements as a substitute. |
Try the following example to parse the query string into variables:
<?php //parse_str() parses the query string into variables parse_str("name=Gopal K Verma&age=45"); echo $name."<br>"; echo $age; ?>Test and see‹/›
Output Result
Gopal K Verma 45