WIKINDX API trunk

URL

Table of Contents

Functions

build_query()  : mixed
Generate URL-encoded query string according to RFC 3986
escape()  : mixed
Escape a component of a URL according to RFC 3986
reduceUrl()  : string
reduce the size of long URL to keep web browser display tidy
getCurrentProtocol()  : string
Return the protocol requested by the HTTP client
getVhost()  : string
Return the vHost name (Virtual Hostname)
URL_exists()  : bool
Check that an internet resource exists

Functions

build_query()

Generate URL-encoded query string according to RFC 3986

build_query(mixed $data) : mixed

This function is a wrapper for http_build_query() where $encoding_type parameter is always PHP_QUERY_RFC3986

Parameters
$data : mixed

Array or object

escape()

Escape a component of a URL according to RFC 3986

escape(mixed $url) : mixed

This function attempts to split a URL into its components and recompose it after decoding and re-encoding the components.

A well-constructed URL should not suffer from this operation. Those that are malformed can be corrected but if an & character appears in the parameters, parameters may disappear.

Use the \URL\build_query() function to construct well-encoded parameters.

Parameters
$url : mixed
Tags
see
https://www.php.net/manual/fr/function.rawurlencode.php#25182
see
http://www.faqs.org/rfcs/rfc3986.html

reduceUrl()

reduce the size of long URL to keep web browser display tidy

reduceUrl(string $text[, false|int $limit = FALSE ]) : string
Parameters
$text : string
$limit : false|int = FALSE

Default is FALSE

Return values
string

getCurrentProtocol()

Return the protocol requested by the HTTP client

getCurrentProtocol() : string
Return values
string

http or https

getVhost()

Return the vHost name (Virtual Hostname)

getVhost() : string

Read also the special 'CLI_VHOST' constant which can be defined to simulate a vHost in CLI mode.

Return an empty string when the vHost cannot be read.

Return values
string

URL_exists()

Check that an internet resource exists

URL_exists(string $url) : bool
Parameters
$url : string
Return values
bool

        
On this page

Search results