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
Stylus Studio® 2010 XML Enterprise Suite raises the bar for productivity in XML development tools.
Millions of XML developers and data integration specialists turn to Stylus Studio's comprehensive and intuitive
XML toolset to tackle today's advanced XML data transformation and aggregation challenges.
|
- XML Pipeline Editor, Debugger and Code Generator
- DataDirect XML Converters
- XQuery Mapper, Editor, Debugger, and Profiler
- XSLT Mapper, Editor, Debugger, Designer, and Profiler
- Java and C# for .Net Code Generation
- XML Schema Designer With Documentation Generator
- XML Editor With Full XPath Integration
Download a free trial now
|
|