Class providing methods for URL parsing.
Static methods contained in this class:
Source for this file: /Url/src/url_tools.php
Version: | //autogen// |
public static string |
getCurrentUrl(
[ $source
= null] )
Returns the current URL as a string from the array $source (by default $_SERVER). |
public static array(string=>mixed) |
parseQueryString(
$str
)
Parses the provided string and returns an associative array structure. |
Returns the current URL as a string from the array $source (by default $_SERVER).
The following fields are used in building the URL:
Then by calling this function (with no parameters), this URL will be returned: 'http://www.example.com/index.php'.
The source of the URL parts can be changed to be other than $_SERVER by specifying an array parameter when calling this function.
Name | Type | Description |
---|---|---|
$source |
array(string=>mixed) | The default array source, default $_SERVER |
Parses the provided string and returns an associative array structure.
It implements the functionality of the PHP function parse_str(), but without converting dots to underscores in parameter names.
Example:
In the first case (parse_str()), $params will be:
In the second case (ezcUrlTools::parseQueryString()), $params will be:
Name | Type | Description |
---|---|---|
$str |
array(string=>mixed) | The string to parse |