PHP parse_str() Function
Complete PHP String Reference
Definition and Usage
The parse_str() function parses a query string into variables.
Syntax
Parameter |
Description |
string |
Required. Specifies the string to parse |
array |
Optional. Specifies the name of an array to store the variables.
This parameter indicates that the variables will be stored in an array. Note: This parameter was added in PHP
4.0.3 |
Tips and Notes
Note: If the array parameter is not set, variables set by this function will overwrite existing
variables of the same name.Note: The magic_quotes_gpc setting in the php.ini file affects the output of this
function. If enabled, the variables are converted by addslashes() before parsed
by parse_str().
Example 1
<?php
parse_str("id=23&name=Kai%20Jim");
echo $id."<br />";
echo $name;
?>
|
The output of the code above will be:
Example 2
<?php
parse_str("id=23&name=Kai%20Jim",$myArray);
print_r($myArray);
?>
|
The output of the code above will be:
Array
(
[id] => 23
[name] => Kai Jim
)
|
Complete PHP String Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|