HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
PHP String Reference : Parse a query string into variables
The parse_str() function parses a query string into variables.
Note:
Parameter | Description |
---|---|
string | Required. Specifies the string to parse |
array | Optional (Required from PHP 7.2). Specifies the name of an array to store the variables. This parameter indicates that the variables will be stored in an array. |
Return Value: | No value is returned |
---|---|
PHP Version: | 4+ |
Changelog: | PHP 7.2.0 - The array parameter is required. PHP 4.0.3 - Added the array parameter. |
Store the variables in an array:
<?php
parse_str("name=Peter&age=43",$myArray);
print_r($myArray);
?>
❮ PHP String Reference