Core Function HTTPParseQuery

From Sputnik Wiki
Jump to: navigation, search
HTTPParseQuery( <string> )

Contents

Description

Parse an HTTP query string into an array.

Parameters

array

A string to be converted into an array by parsing it as an HTTP query string.

Return Value

Success: Returns an array containing all key+values of the parsed query.

Failure: Return null.

Remarks

None.

Example

// Make an array to be converted to a query string
my $queryArray = array("Cat" => "Meow", "Dog" => "Woof", "Testy" => "Test&Hello");
// Convert it
my $query = HTTPMakeQuery($queryArray);
// Print the result
say $query;
// Decode the query
my $arrayAgain = HTTPParseQuery($query);
printr $arrayAgain;
// Prints:
// Cat=Meow&Dog=Woof&Testy=Test%26Hello
// Array
// (
//     [Cat] => Meow
//     [Dog] => Woof
//     [Testy] => Test&Hello
// )
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox