WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/build query

Description

Build URL query based on an associative and, or indexed array.

This is a convenient function for easily building url queries. It sets the separator to '&' and uses _http_build_query() function.

Usage

<?php build_query$data ); ?>

Parameters

$data
(array) (required) URL-encode key/value pairs.
Default: None

Return Values

(string) 
URL encoded string

Change Log

Since: 2.3

Source File

build_query() is located in wp-includes/functions.php