Less than 1 minute
build_url
Build a correctly formatted URL from argument list.
public build_url({Array})
This function will build a correctly formatted HTTP compliant URL using a list of parameters. If any of the parameters are null then they will be omitted from the formatted output, including any extra values.
For example, you can specify a username and a password which will be formatted as username:password@. However if you omit the password you will simply get username@.
Parameters
Parameter | Type | Description |
---|---|---|
$scheme | string | The protocol to use. Usually http or https. |
$host | string | Hostname |
$port | int | (optional) Port |
$user | string | (optional) Username |
$pass | string | (optional) User password. If set, a username is required. |
$path | string | (optional) Path suffix |
$query | array | (optional) Array of parameters to send. ie: the stuff after the '?'. Uses http_build_query to generate string. |
$fragment | string | (optional) Anything to go after the '#' |
Generated by Hazaar API Doc Generator