← All built-ins / http_build_query()
http_build_query()
http_build_query(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $data | map | key => value pairs |
Return value
URL-encoded query string.
Example
echo http_build_query(["q" => "holy php", "page" => 2]);
q=holy+php&page=2