← All built-ins / http_build_query()

http_build_query()

http_build_query(string $s): string

Parameters

NameTypeDescription
$datamapkey => value pairs

Return value

URL-encoded query string.

Example

echo http_build_query(["q" => "holy php", "page" => 2]);
q=holy+php&page=2

See also

parse_url()urlencode()http_post()